Advertisement

C语言程序设计现代方法第5章练习题

阅读量:

第一题

复制代码
    #include <stdio.h>
    #include<string>)
    int main(void)
    {
    	int a;
    	printf("Entger a number:");
    	scanf_s("%d", &a);
    	if (a < 10)
    		printf("The number %d has 1 digtis\n",a);
    	else if(a<100)
    		printf("The number %d has 2 digtis\n", a);
    	else if (a<1000)
    		printf("The number %d has 3 digtis\n", a);
    	else 
    		printf("The number %d has 4 digtis\n", a);
    	system("pause");
    	return 0;
    }
    
    
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    

全部评论 (0)

还没有任何评论哟~