Documente Academic
Documente Profesional
Documente Cultură
Program:
1
2 #include <iostream>
3 using namespace std;
int a;
4 int main()
5 {
6 cin >> a;
7 if (a % 2 == 0)
cout << "par";
8
else
9 cout << "impar";
10 return 0;
11 }
12
Program:
1
2 #include <iostream>
3 using namespace std;
int a, b, maxim;
4 int main()
5 {
6 cin >> a >> b;
7 if (a > b)
8 maxim = a;
else
9 maxim = b;
10 cout << maxim;
11 return 0;
12 }
13
3. Determinați câte sticle de x litri cu apă trebuie deschise pentru a
umple un vas de y litri.
Program:
1
2 #include <iostream>
3 using namespace std;
int x, y, nrsticle;
4 int main()
5 {
6 cin >> x >> y;
7 if(y % x == 0)
nrsticle = y / x;
8
else
9 nrsticle = y / x + 1;
10 return 0;
11 }
12