Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- // https://disk.yandex.ru/d/7vJs2xn1DoJcCg
- // Оптимизировать решение
- #include <iostream>
- using namespace std;
- ///////////////////////////////////////////////
- int main() //
- {
- int d1;
- cin >> d1;
- int d2 = d1 / 7;
- if(d1 % 7 == 0) cout << d2 * 5845;
- if(d1 % 7 == 1) cout << d2 * 5845 + 1000;
- if (d1 % 7 == 2)
- {
- cout << d2 * 5845 + 1945;
- }
- if (d1 % 7 == 3)
- {
- cout << d2 * 5845 + 2835;
- }
- if (d1 % 7 == 4)
- {
- cout << d2 * 5845 + 3670;
- }
- if (d1 % 7 == 5)
- {
- cout << d2 * 5845 + 4450;
- }
- if (d1 % 7 == 6)
- {
- cout << d2 * 5845 + 5175;
- }
- }
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int nArr[100];
- ////////////////////////////////////////////////////////
- int main() //
- {
- srand(time(0));
- for(int i = 0; i < 10; i++)
- {
- nArr[i] = rand();
- printf("nArr[%d] = %d \n", i, nArr[i]);
- }
- }
- /*
- #include <stdio.h>
- int n = 7;
- // Разбить на if & goto
- ////////////////////////////////////////////////////////
- int main() //
- {
- switch(n)
- {
- case 5: printf("May \n");
- break;
- case 7: printf("July \n");
- break;
- case 8: printf("August\n");
- break;
- default: printf("Error!\n");
- }
- }
- */
- /*
- #include <stdio.h>
- char c = 48;
- char szArr[50] = "SONY";
- ////////////////////////////////////////////////////////
- int main() //
- {
- printf(" c = %c\n", c );
- printf("szArr = %s\n", szArr);
- printf("- - - - - - - - - \n");
- int i = 0;
- L_01: printf("szArr[%d] = %c\n", i, szArr[i]);
- i++;
- if(i < 5) goto L_01;
- return 0;
- }
- #include <stdio.h>
- char c = 48;
- char szArr[50] = "SONY";
- ////////////////////////////////////////////////////////
- int main() //
- {
- printf(" c = %c\n", c );
- printf("szArr = %s\n", szArr);
- printf("- - - - - - - - - \n");
- for(int i = 0; i < 5; i = i + 1)
- {
- printf("szArr[%d] = %c\n", i, szArr[i]);
- }
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement