练习专区

今天的一小步就是明天的一大步
Problem 2028 寻找A字符
Accepted: 0   Total Submit: 0
Time Limit: 1000ms   Memory Limit: 30720KB
Description
给你一个程序,但有2个空的代码要填,并在//后按要求写上注释。
#include<stdio.h>
int main()
{
char ch,t;//说明ch,t的用处2分
int id=0;//说明id的用处2分
//请在下面声明自定义函数(3分)
while(scanf("%c%c",&ch,&t)!=EOF){
id++;
if( ){//请在括号内加上调用函数,传参ch(5分)
printf("第%d个字符是A\n",id);
break;//break在此处的作用2分
}
}
return 0;
}
int isA(char ch){//函数返回了什么?3分
if(ch==65){//判断什么?2分
return 1;
}else{
return 0;
}
}
Input
有多行输入,每行输入1个字符。
Output
输出找到的A是第几个字符。
Sample Input
s
a
A
M
Sample Output
第3个字符是A
Hint
提交     返回