Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- /// Varianta 52
- /// I.2)
- /*
- int n, i, x, c = 0, d = 0;
- cin >> n;
- for(i = 1; i <= n; i++)
- {
- cin >> x;
- while(!(x % 2))
- {
- x /= 2;
- d++;
- }
- while(!(x % 5))
- {
- x /= 5;
- c++;
- }
- }
- if(c < d)
- cout << c << "\n";
- else cout << d << "\n";
- */
- /// II.5)
- /*
- int n, i, j, nr = 0, f;
- char s[30];
- cin >> n;
- for(i = 0; i <= n; i++)
- {
- cin.getline(s, 30);
- f = 1;
- for(j = 0; (s[j] != NULL) && f; j++)
- if(strchr("aeiou", s[j]) == NULL)
- f = 0;
- if(f)
- nr++;
- }
- cout << nr-1;
- */
- /// III.4)
- int n, k;
- cin >> n >> k;
- if((n - (k * (k-1))/2) % k == 0)
- return (n - (k * (k-1))/2) / k;
- cout << "Nu exista.";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement