immuntasir

bla

Feb 18th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3.     int a=0,b=0,c=0,temp,input;
  4.     while (1) {
  5.         scanf("%d",&input);
  6.         if (input<0) break;
  7.         if (input>a) {
  8.             c = b;
  9.             temp = a;
  10.             a = input;
  11.             b = temp;
  12.         }
  13.         else if (input>b) {
  14.             temp = b;
  15.             b = input;
  16.             c = temp;
  17.         }
  18.         else if (input>c) c=input;
  19.     }
  20.     printf("%d %d %d\n",a,b,c);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment