Va rog sa rezolvati exercitiile acestea cu tot cu indicatii vs rog!! Dau coroana!!!
Răspunsuri la întrebare
1.
#include <iostream>
using namespace std;
int main()
{
int nr;
cin>>nr;
while(nr)
{
cout<<nr%10<<" ";
nr/=10;
}
return 0;
}
2.
#include <iostream>
using namespace std;
int main()
{
int nr;
cin>>nr;
nr=nr/10%10*10+nr%10*100+nr/100;
cout<<nr;
return 0;
}
3.
#include <iostream>
using namespace std;
int main()
{
int nr;
cin>>nr;
nr=nr/1000*1000+nr%10+8*100+9*10;
cout<<nr;
return 0;
}
4.
#include <iostream>
using namespace std;
int main()
{
int nr;
cin>>nr;
nr=nr/1000*10+nr%10;
cout<<nr;
return 0;
}
5.
#include <iostream>
using namespace std;
int main()
{
int nr1,nr2;
cin>>nr1;
nr2=nr1;
nr1=nr1/1000+nr1%10*1000+nr1/10%10*10+nr1/100%10*100;
nr2=nr2/1000*1000+nr2%10+nr2/10%10*100+nr2/100%10*10;
cout<<"a)"<<nr1<<"\n"<<"b)"<<nr2;
return 0;
}