#include <stdio.h>
#include <stdlib.h>
#define N 5
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
long input;
char ch;
while(scanf("%ld",&input)!=1)
{
while((ch=getchar())!='\n')
putchar(ch);
}
printf("%ld",input);
return 0;
}
可以啊
#include <stdio.h>
#include <stdlib.h>
#define N 5
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
long input;
char ch;
while(scanf("%ld",&input)!=1)
{
while((ch=getchar())!='\n')
;//putchar(ch); //这里的输出只是告诉你你输入了什么,实际使用应该去掉
}
printf("%ld",input);
return 0;
}