Răspuns :
Salut!
Ai rezolvarea la toate problemele in limbajul C++ mai jos
- 1.
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a + b << " " << a * b;
return 0;
}
- 2.
#include <iostream>
using namespace std;
int main()
{
int lun, lat;
cin >> lun >> lat;
cout << lun * lat << " " << 2 * (lun + lat);
return 0;
}
- 3.
#include <iostream>
using namespace std;
int main()
{
int n, s = 0;
cin >> n;
for (int i = 1; i <= n; ++i)
{
s += i;
}
cout << s;
return 0;
}
- 4.
#include <iostream>
using namespace std;
int main()
{
int x;
cin >> x;
int h = x / 60;
x = x - 60 * h;
cout << h << " ore si " << x << " minute";
return 0;
}
- 5.
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
cout << (double)(a + b + c)/3;
return 0;
}