Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

otsall / iax0583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • iax0583
  • Lab9
  • task3.c
Find file
BlameHistoryPermalink
  • otsall's avatar
    Upload New File · a7d496ee
    otsall committed 6 years ago
    a7d496ee
task3.c 460 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#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;
}