Возможный вариант в C++ #include <iostream> int main() { using namespace std; int N; cout << "Enter N: "; cin >> N; int num; int max = 1; int i; for (i = 0; i < N; ++i) { cout << "Enter #" << i + 1 << " number: "; cin >> num; if ((num - 9) % 10 != 0 && num % 3 == 0) { max = num; break; } } for (int j = i + 1; j < N; ++j) { cout << "Enter #" << j + 1 << " number: "; cin >> num; if ((num - 9) % 10 != 0 && num % 3 == 0) if (num > max) max = num; } if (max != 1) cout << "Max number div by 3 and don't end 9: " << max << endl; else cout << "No numbers div by 3 and don't end 9" << endl; return 0; }
#include <iostream>
int main()
{
using namespace std;
int N;
cout << "Enter N: ";
cin >> N;
int num;
int max = 1;
int i;
for (i = 0; i < N; ++i)
{
cout << "Enter #" << i + 1 << " number: ";
cin >> num;
if ((num - 9) % 10 != 0 && num % 3 == 0)
{
max = num;
break;
}
}
for (int j = i + 1; j < N; ++j)
{
cout << "Enter #" << j + 1 << " number: ";
cin >> num;
if ((num - 9) % 10 != 0 && num % 3 == 0)
if (num > max)
max = num;
}
if (max != 1)
cout << "Max number div by 3 and don't end 9: " << max << endl;
else
cout << "No numbers div by 3 and don't end 9" << endl;
return 0;
}
#include <cmath>
using namespace std;
void main()
{
int n,sum=0;
float y,k=0;
cin >> n;
int *mass = new int[n];
for (int i = 0;i < n;++i)
{
cin >> mass[i];
}
for (int i = 0;i < n;++i)
{
if (mass[i] >0 )
{
k++;
y=pow(mass[i],2);
cout<<y;
sum+=mas[i]
}
}
system("pause");
}
2)#include <iostream>
#include <cmath>
using namespace std;
void main()
{
int s,p,r,day=0;
cin >> s>>p>>r;
float km=s;
while(r>km)
{
km+=km*p/100;
day++;
}
cout << " km = " << km << " day = " << day << endl;
system ("pause");
}