gmth.net
当前位置:首页 >> 用字符指针编程序实现输入一个人民币小写金额值,转... >>

用字符指针编程序实现输入一个人民币小写金额值,转...

#include "stdio.h" static void get_RMB_number(int *number); static void convert(int *number); int main(void) { int number; get_RMB_number(&number); convert(&number); } static void get_RMB_number(int *number) { char ch; printf("...

#include void main() { char s[81],*p; printf("请输入字符串:"); gets(s); p=s; while(*p) { if(*p>='a'&&*p

char *transfer(char *str){ char *buffer; buffer = (char *)malloc(strlen(str)*sizeof(char)); strcpy(buffer,str); int i = 0; while(buffer[i]!='\0') { if(buffer[i]='a') { buffer[i] -= 32; } i++; } return buffer;}

void convert(char *s){ while(*s) { if(*s >= 'A' && *s = 'a' && *s

好吧,用指针: #include void a_to_A(char *s) { char *p=s; for(int i=0;s[i]!='\0';) if(s[i]>='a'&&s[i]

#include #include "string.h"int main(void){ char s[100],b[100],m,n,i; printf("Input a string...\ns="); gets(s); printf("Input m & n(int m,n>=0)...\n"); if(scanf("%d%d",&m,&n)!=2 || m(i=strlen(s)) || ni){ printf("Input error, ex...

char s[100]={'\0'};char *p;int i=0,j=0;scanf("%s",s);p=s;while(*(p+i)!='\0'){ if(*(p+i)!='a') { *(p+j)=*(p+i); j++; } i++;}*(p+j)='\0';//试下,没经过测试

是只倒置输出数字,还是在字符串中倒置数字,再输出?

#include "stdio.h" #include void main() { char *p,a[200],b[200]; int i,m; p=a; printf("\nEnter a string:\n"); gets(a); m=strlen(a); p=p+m-1; for(i=0;i

#includevoid main() { int i; char string[20],*p; printf("Input:"); gets(string);// p=string; i=0; while(p[i++]!='\0'); printf("输入的字符串的长度为%d\n",i-1); }

网站首页 | 网站地图
All rights reserved Powered by www.gmth.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com