wonman

Untitled

Feb 12th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int main(int argc, char** argv) {
  10.  
  11. string table[100];
  12.  
  13. table[100] = argv[1];
  14. int z;
  15. int i;
  16.  
  17. for(i=0; i<100; i++)
  18. {
  19.    
  20.     if(table[i] == ",")
  21.     {
  22.         z = i;
  23.     }
  24.  
  25. }
  26.  
  27. int tab1[z]; //wielkosc tabelki do przecinka
  28. int tab2[i-z]; //wielkosc tabelki od przcinka do konca i (100)
  29.  
  30. ofstream OUT;
  31. OUT.open("liczby.txt" , ios::out);
  32.  
  33.  
  34. for(int s=0; s<100; s++)
  35. {
  36.     for(int j=0; j<100; j++)
  37.     {
  38.         if( tab1[j] == tab2[s])
  39.         {
  40.             OUT<< tab1[s];
  41.             s++; // zeby liczby sie nie potwaraly????????????
  42.         }
  43.     }
  44. }
  45.  
  46.  
  47. OUT.close(); //poprawnie?
  48.  
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment