Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <locale.h>
- int step;
- int sec;
- int def(int);
- /////////////////////////////////////////////////////
- int main()
- {
- char *locale = setlocale(LC_ALL, "");
- printf("Введите секунды:"); scanf("%d", &sec);
- step = def(sec);
- printf("Лягушка сейчас в точке: %d", step);
- }
- //////////////////////////////////////////////////////
- int def(int sec_1)
- {
- int step_1 = 0;
- L_01: if(sec_1 <= 5) step_1 = sec_1;
- if(sec_1 > 5 && sec_1<=10)
- {
- step_1 = 5-(sec_1%5);
- }
- if(sec_1 > 10)
- {
- sec_1 = sec_1 % 10;
- goto L_01;
- }
- return step_1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement