C言語——インスタンス029逆シーケンス出力

1045 ワード

/*
	Name: 
	Copyright: 
	Author: 
	Date: 31/07/17 09:46
	Description: 
		【  29】   :      5     ,
		  : 、      , 、         。
		
		1.     :         
*/

#include 
int main()
{
	long a,b,c,d,e,f,x;				//        
	while(printf("              :") && scanf("%ld",&x) != EOF) 
	{
		//       ,        ,          
		f = x % 1000000 / 100000;		//    
		a = x % 100000 / 10000;			//  
		b = x % 10000 / 1000;			//  
		c = x % 1000 / 100;				//  
		d = x % 100 / 10;				//  
		e = x % 10;						//  	
		if(f != 0)
		{
			printf("           !!!

"); continue; } else if(a != 0) { printf(" :%2d%2d%2d%2d%2d

",e,d,c,b,a); } else if(b != 0) { printf(" :%2d%2d%2d%2d

",e,d,c,b); } else if(c != 0) { printf(" :%2d%2d%2d

",e,d,c); } else if(d != 0) { printf(" :%2d%2d

",e,d); } else { printf(" :%2d

",e); } } return 0; }