New Text Document

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Maria Petric5:35 PM

#include <bits/stdc++.h>
using namespace std;
int n,x,c=1;
int main()
{
cin>>n;
x=n;
while(x>10)
{
x/=10;
c=c*10;
}
n=n%c;
n=n*10+x;
cout<<n;
return 0;
}
Hajnal Faur5:38 PM
12345
123345
Hajnal Faur5:49 PM
958
Petru Craciunoiu5:55 PM
//12345-->123345
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x,copie,cf,cate=0,p=1,nou=0,nr=1;
cin>>x;
copie=x;
while(copie>0){
copie/=10;
cate++;
}
int pMij=cate/2+1;
while(x>0){
cf=x%10;
if(p==pMij){
nou+=cf*nr;
nr*=10;
nou+=cf*nr;
}
else{
nou+=cf*nr;
}
nr*=10;p++;x/=10;
}
cout<<nou;
return 0;
}
Hajnal Faur5:55 PM
n=1234
123,124,134,234
You6:04 PM
#include <iostream>

using namespace std;


int main() {
int n, nr = 0;
cin >> n;
int cn = n;
while(cn > 0) {
nr++;
cn = cn / 10;
}
int cnt = 0;
for(int i = 0; i < nr; i++){
cn = n;
int poz = 0, nnou = 0, p = 1;
while(cn > 0) {
if(poz != i) {
nnou = nnou + (cn % 10 )* p;
p = p * 10;
}
cn = cn / 10;
poz++;
}
cout<<nnou<<" ";
}

return 0;
}

cin>>x;
p=1;
while(x/p!=0)
{
nou=x/(p*10)*p+x%p;
cout<<nou<<endl;
p=p*10;
}

You might also like