Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int g[300],h[300];
  5.  
  6. int main(){
  7.     freopen("input.txt","r",stdin);
  8.     //freopen("output.txt","w",stdout);
  9.     int p=0, a=0, gc=0;
  10.     do {
  11.         p=a;
  12.         cin>>a;
  13.         g[++gc]=a;
  14.     } while (p<a);
  15.  
  16.     h[1]=a;
  17.     int hc=1;
  18.     while (!EOF){ //вот тут надо по идее читать до конца файла
  19.         h[++hc]=a;
  20.         cin>>a;
  21.     }
  22.  
  23.     for (int i=1; i<=gc; i++) cout<<g[i]<<' ';
  24.     cout<<endl;
  25.     for (int j=1; j<=hc; j++) cout<<h[j]<<' ';
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement