Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- char s[1005];
- scanf("%s", s);
- int i, idx;
- for(i = 0; i < strlen(s); i++)
- {
- if(s[i] == '.' && s[i-1] != '9')
- {
- idx = i;
- if(s[i+1] >= '5')
- {
- s[i-1]++;
- break;
- }
- else break;
- }
- else if(s[i] == '.' && s[i-1] == '9')
- {
- printf("GOTO Vasilisa.\n");
- return 0;
- }
- }
- for(i = 0; i < idx; i++) printf("%c", s[i]);
- printf("\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment