Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- string liczba1;
- string liczba2;
- int cos;
- cout<<"Podaj liczbe: ";
- cin>>liczba1;
- liczba2=liczba1;
- int d=liczba1.length();
- for(int i=0;i<d;i++)
- {
- if(liczba1[i]==52)
- {
- liczba1[i]=51;
- liczba2[i]=49;
- }
- else
- {
- liczba2[i]=48;
- }
- }
- for(int j=0;j<d;j++)
- {
- cout<<liczba1[j];
- }
- cout<<endl;
- for(int k=0;k<d;k++)
- {
- if((liczba2[k]>48)||(cos>0))
- {
- cout<<liczba2[k];
- cos++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement