Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- /* 1 c)
- int a = 0;
- for(int i = 5; i <= 10; i++){
- a = a + i;
- }
- cout << a << endl;*/
- /*2
- int a = 0;
- int n = 0;
- cin >> a;
- cin >> n;
- int ats = a;
- for (int i = 0; i < n-1; i++){
- ats = ats * a;
- }
- cout << ats << endl;*/
- /*3
- int a = 1;
- for (int i = 1; i <= 5; i++){
- a = a * i;
- }
- cout << a;*/
- /*4
- for(int i = 1; i <= 15; i++){
- cout << i * i << endl;
- }*/
- /*5
- for(int i = 100; i > 10 ; i-=1){
- if(i % 2 != 0){
- cout << i << endl;
- }
- }*/
- /*int trecias = 0;
- for(int i = 100; i <= 999; i++){
- trecias = i % 10;
- int b = i % 2;
- switch(trecias){
- case 0:
- cout << i << endl;
- break;
- default:
- int c = i % trecias;
- if(b == 0 && c == 0){
- cout << i << endl;
- }
- }
- }*/
- /*int n = 0;
- int m = 0;
- int suma = n + m;
- cin >> n;
- cin >> m;
- for(int i = n; i <= m; i++){
- if(i % 10 == 0){
- suma = suma + i;
- }
- }
- cout << suma << endl;*/
- /*int c = 0;
- int d = 0;
- int skaicius = 0;
- int skaiciusdu = 0;
- int suma = c + d;
- cin >> c;
- cin >> d;
- for(int i = c; i <= d; i++){
- skaicius = i % 10;
- skaiciusdu = i / 10 % 10;
- if(skaicius == 3 && skaiciusdu == 3){
- suma = suma + 1;
- }
- }
- cout << suma << endl;*/
- int a = 0;
- int b = 0;
- cin >> a;
- cin >> b;
- for(int i = 1; i <= 999; i ++){
- a = a / i;
- b = b / i;
- if (a == b){
- cout << a << endl;
- return 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement