Ajutor,dau coroana si 100 de puncte
Răspunsuri la întrebare
1.
#include<iostream>
using namespace std;
int main() {
int n, s = 0;
cin >> n;
for (int i = 3; i <= n; i += 3)
s += i;
cout << s;
//sau poti scrie direct cout<<(n*n-3*n)/6;
return 0;
}
2.
#include<iostream>
using namespace std;
int main() {
int a, b, min = 10, max = -1;
cin >> a >> b;
while (a != 0 && b != 0) {
if (a % 10 < min)
min = a % 10;
if (b % 10 > max)
max = b % 10;
a /= 10;
b /= 10;
}
cout << min * max;
return 0;
}
3.
#include<iostream>
using namespace std;
int main() {
int a, k = 0;
cin >> a;
while (a != 0) {
if (a % 10 % 2 == 1)
k++;
a /= 10;
}
cout << k;
return 0;
}
4.
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int x, y, z, t;
cin >> x >> y >> z >> t;
cout << sqrt(x + sqrt(((z + t) * (z + t) * (z + t) + 5) / (y + (x + y / z) / (sqrt(t + 1 / x)) + 4)));
return 0;
}