Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define N 100
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- void main()
- {
- while(1)
- {
- int i;
- printf("\nn? "); int na; scanf("%d", &na);
- if(na<=0 || na>N) break;
- printf("A? "); int a[N]; for (i=0;i<na; scanf("%d", &a[i++]));
- int b[N], c[N], nb=0, nc=0;
- for (i=0; i<na;a[ i]<0 ? (b[nb++]=a[i++]) : (c[nc++]=a[i++]));
- printf("B= "); for (i=0; i<nb; printf("%d ", b[i++])); printf("\n");
- printf("C= "); for (i=0; i<nc; printf("%d ", c[i++])); printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement