1. #include <iostream> using namespace std; int intrev(int x) { return x ? cout << x % 10, intrev(x / 10) + 1 : 0; } int main() { int val = 0; cin >> val; intrev(val); system("pause"); return 0; }
2. #include <iostream> using namespace std; int main() { int val = 230; int mul = 1; int temp = 1; while (val != 0) { temp = val % 10; if (temp != 0) mul *= temp; val /= 10; } cout << "Res = " << mul << endl; system("pause"); return 0; }
S:string; a, i, k, b, n:integer; begin readln(s); readln(a); k:=1; for i:=1 to length(s) do begin k:=k*val(s[i], n); if val(s[i], n)=a then b:=b+1;end; writeln(k); if b=0 then writeln('yes') else writeln('no'); readln; end. 2 a:array[1..1000] of integer; begin k:=1; for i:=100 to 999 if (((i+1) mod 2))=0) and (((i+2) mod 3)=0) and (((i+3) mod 4)=0) and (((i+4) mod 5)=0) then begin a[k]:=i; k:=k+1; end; for i:=1 to k do writeln(a[i]); readln; end.
3 s, a:string; i, k:integer; begin readln(s); readln(a); for i:=1 to length(s) do if s[i]=a then s[i]:=''; writeln(s); readln; end.
#include <iostream>
using namespace std;
int intrev(int x)
{
return x ? cout << x % 10, intrev(x / 10) + 1 : 0;
}
int main()
{
int val = 0;
cin >> val;
intrev(val);
system("pause");
return 0;
}
2.
#include <iostream>
using namespace std;
int main()
{
int val = 230;
int mul = 1;
int temp = 1;
while (val != 0) {
temp = val % 10;
if (temp != 0)
mul *= temp;
val /= 10;
}
cout << "Res = " << mul << endl;
system("pause");
return 0;
}
a, i, k, b, n:integer;
begin
readln(s);
readln(a);
k:=1;
for i:=1 to length(s) do begin
k:=k*val(s[i], n);
if val(s[i], n)=a then b:=b+1;end;
writeln(k);
if b=0 then writeln('yes')
else writeln('no');
readln;
end.
2
a:array[1..1000] of integer;
begin
k:=1;
for i:=100 to 999
if (((i+1) mod 2))=0) and (((i+2) mod 3)=0) and (((i+3) mod 4)=0) and (((i+4) mod 5)=0) then begin a[k]:=i; k:=k+1; end;
for i:=1 to k do
writeln(a[i]);
readln;
end.
3
s, a:string;
i, k:integer;
begin
readln(s);
readln(a);
for i:=1 to length(s) do
if s[i]=a then s[i]:='';
writeln(s);
readln;
end.