Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- //prog5
- int main()
- {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- const int N = 6;
- int mas1[N], mas2[N];
- int c=0;
- for(int i=0; i<N; i++)
- cin>>mas1[i];
- for(int i=0; i<N; i++){
- if(mas1[i] > 0) {
- mas2[c]=mas1[i];
- c++;
- }
- }
- for(int i=0; i<c; i++){
- cout<<mas2[i]<<' ';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement