1. X:=4; if x>0 then y:=sqr(x); writeln(y)
2. If x>0 then y:=2*x else
y:=3*abs(x); writeln(y)
3. Case 5<>5 of
True:writeln(1);
False:writeln(3); end;
4. Case 6 of 2: writeln(0); 4:
writeln(1) Else writeln(2);
end;
5. Begin x:=5; x:=ord(x);
x:=succ(x); writeln(x);
end;
6. X:=10; if x>10 then y:=x*x
else y:=2*x; writeln(x)
7. X:=10; if odd(x) then y:=x
div 2 else y:=x mod 2;
writeln(y)
8. K:=0; case 8 of 6:
writeln(k); 8: begin
k:=k+1; writeln(k); end;
End;
#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");
}