Advertisement
J00ker

ffml\

Sep 20th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     /// Varianta 52
  9.     /// I.2)
  10.     /*
  11.     int n, i, x, c = 0, d = 0;
  12.     cin >> n;
  13.     for(i = 1; i <= n; i++)
  14.     {
  15.         cin >> x;
  16.         while(!(x % 2))
  17.         {
  18.             x /= 2;
  19.             d++;
  20.         }
  21.         while(!(x % 5))
  22.         {
  23.             x /= 5;
  24.             c++;
  25.         }
  26.     }
  27.     if(c < d)
  28.         cout << c << "\n";
  29.     else cout << d << "\n";
  30.     */
  31.  
  32.     /// II.5)
  33.     /*
  34.     int n, i, j, nr = 0, f;
  35.     char s[30];
  36.     cin >> n;
  37.     for(i = 0; i <= n; i++)
  38.     {
  39.         cin.getline(s, 30);
  40.         f = 1;
  41.         for(j = 0; (s[j] != NULL) && f; j++)
  42.             if(strchr("aeiou", s[j]) == NULL)
  43.                 f = 0;
  44.         if(f)
  45.             nr++;
  46.     }
  47.     cout << nr-1;
  48.     */
  49.  
  50.     /// III.4)
  51.     int n, k;
  52.     cin >> n >> k;
  53.     if((n - (k * (k-1))/2) % k == 0)
  54.         return (n - (k * (k-1))/2) / k;
  55.     cout << "Nu exista.";
  56.     return 0;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement