Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Zadanie 5
- #include <iostream>
- #include <cstdlib>
- #include <fstream>
- using namespace std;
- int main(int argc, char** argv)
- {
- fstream file;
- file.open("liczby.txt");
- int x;
- for (int i=0; i<1000; i++)
- {
- file>>x;
- int p=0;
- cout<<x<<"-> ";
- for (int d=0; d<=x; d++)
- {
- while (x!=0)
- {
- p=p+x%10;
- x=x/10;
- }
- cout<<p;
- }
- cout<<endl;
- }
- cout<<"--------------------------------"<<endl;
- cout<<"Kurwa przypadkowo mi wyszlo XD";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement