Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- string odwrocLiczbe(string number)
- {
- string nowy;
- for(int a=number.length(); a>=0; a--)
- {
- nowy=nowy+number[a];
- }
- return nowy;
- }
- int main() {
- string number;
- cout <<"podaj liczbe: :" << endl;
- cin >> number;
- cout <<"liczba odwrotna to: " << odwrocLiczbe(number);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement