Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int g[300],h[300];
- int main(){
- freopen("input.txt","r",stdin);
- //freopen("output.txt","w",stdout);
- int p=0, a=0, gc=0;
- do {
- p=a;
- cin>>a;
- g[++gc]=a;
- } while (p<a);
- h[1]=a;
- int hc=1;
- while (!EOF){ //вот тут надо по идее читать до конца файла
- h[++hc]=a;
- cin>>a;
- }
- for (int i=1; i<=gc; i++) cout<<g[i]<<' ';
- cout<<endl;
- for (int j=1; j<=hc; j++) cout<<h[j]<<' ';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement