You are on page 1of 1

1.

d.

2.
a.
17396

b.
300-200-100-0

c.
#include <iostream>

using namespace std;

int main()
{
int x,y;
cin>>x;
y=0;
while (x!=0)
{
while (x>9)
x/=10;
y=y*10+x;
cin>>x;
}
cout<<y;
return 0;
}

d.
#include <iostream>

using namespace std;

int main()
{
int x,y;
cin>>x;
y=0;
if (x<1)
{
cout<<0; return 0;
}
do
{
if (x>9)
{
do
x/=10;
while (x>9);
}
y=y*10+x;
cin>>x;
}while (x!=0);
cout<<y;
return 0;
}

You might also like