Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int a=0,b=0,c=0,temp,input;
- while (1) {
- scanf("%d",&input);
- if (input<0) break;
- if (input>a) {
- c = b;
- temp = a;
- a = input;
- b = temp;
- }
- else if (input>b) {
- temp = b;
- b = input;
- c = temp;
- }
- else if (input>c) c=input;
- }
- printf("%d %d %d\n",a,b,c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment