Advertisement
Kosty_Fomin

Untitled

Feb 19th, 2014
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3.  
  4. int main(int argc, const char * argv[])
  5. {
  6.     int a=0;
  7.    
  8.     scanf ("%d", &a);
  9.    
  10.     if (a==0) {
  11.        
  12.         printf("%d",0);
  13.        
  14.     }
  15.    
  16.     if (a<0){
  17.         for (int i = a; i<= -a; i++) {
  18.            
  19.             if(i==0) continue;
  20.            
  21.             if (a%i==0){
  22.                
  23.                 printf("%d",i);
  24.             }
  25.         }
  26.        
  27.     } else {
  28.        
  29.         for (int i = -a; i<=a; i++) {
  30.            
  31.             if(i==0) continue;
  32.            
  33.             if (a%i==0){
  34.                
  35.                 printf("%d",i);
  36.                
  37.             }
  38.         }
  39.     }
  40.     return 0;
  41. }v
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement