Commit a7d496ee by otsall

Upload New File

parent c21cfaac
Showing with 30 additions and 0 deletions
#include <stdio.h>
#include <ctype.h>
#include <string.h>
int isint(char a);
int main(){
char string[100];
int len,
i;
do{
puts("please input an integer.");
scanf("%s", string);
len = strlen(string);
for(i = 0; i < len; i++){
if(isint(string[i]) == 0){
puts("input is not an integer");
break;
}
}
}while(i < len);
puts("the input is an integer");
return 0;
}
int isint(char a){
int result = isdigit(a);
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment