VA ROG MULT IMI TREBUIE 9 PROBLEME REZOLVATE ORICARE DINTRE ELE VA ROG MULT
Răspunsuri la întrebare
Salut!
Ai rezolvarile la 9 probleme in limbaj C++ mai jos
1.
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a + b;
return 0;
}
2.
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a - b;
return 0;
}
3.
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << (a + b + c + d) / 4;
return 0;
}
4.
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
if (n % 2 == 0)
{
cout << "PAR";
}
else
{
cout << "IMPAR";
}
return 0;
}
5.
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
if (n >= 5)
{
cout << "PROMOVAT";
}
else
{
cout << "CORIGENT";
}
return 0;
}
6.
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
if (c >= a && c <= b)
{
cout << "DA";
}
else
{
cout << "NU";
}
return 0;
}
7.
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << (a + b) % 10;
return 0;
}
8.
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
cout << n % 100;
return 0;
}
9.
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
if (n >= 0)
{
cout << "POZITIV";
}
else
{
cout << "NEGATIV";
}
return 0;
}