用指针编写程序:输入3行字符(每行60个字符以内),要求统计每行有多少...

来源:百度知道 编辑:UC知道 时间:2024/05/27 01:43:09
大写字母、小写字母、空格及标点符号。
大虾帮忙
写得好有追加

详细代码如下:
#include<stdio.h>
#include<string.h>
#include<ctype.h>
void GetResult(int *upper,int *lower,int *space,int *punct,char *inStr);
void OutPutResult(int row,int upper,int lower,int space,int punct);

main()
{
char in1[60];
char in2[60];
char in3[60];
int upper;
int lower;
int space;
int punct;
printf("请输入第一行字符:\n");
gets(in1);
printf("请输入第二行字符:\n");
gets(in2);
printf("请输入第三行字符:\n");
gets(in3);
GetResult(&upper,&lower,&space,&punct,in1);
OutPutResult(1,upper,lower,space,punct);
GetResult(&upper,&lower,&space,&punct,in2);
OutPutResult(2,upper,lower,space,punct);
GetResult(&upper,&lower,&space,&punct,in3);
OutPutResult(3,upper,lower,space,punct);
}
void GetResult(int *upper,int *lower,int *space,int *punct,char *inStr)
{
int len;
int i;
*