c语言程序题 输入一个数,每敲一次回车加一次1
来源:百度知道 编辑:UC知道 时间:2024/05/31 22:30:29
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int p;
char c;
printf("num:");
scanf("%d",&p);
while(c!='#')
{
c=getchar();
if(c==10) p++;
}
printf("now p=%d\n",p);
system("pause");
return 0;
}
输入 # 结束。亲测通过..