Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- struct vect {
- int x;
- int y;
- int z;
- };
- int main() {
- int n;
- char c;
- if (scanf("%d%c", &n, &c) == 2 && c == '\n') {
- int f = 1;
- int *arr = malloc(n * sizeof(int));
- char s;
- for (int i = 0; i < n; i++) {
- if (scanf("%d%c", arr+i, &s) == 2 && (s == ' ' || s == '\n')) {
- continue;
- } else {
- f = 0;
- printf("n/a");
- break;
- }
- }
- if (f == 1)
- for (int i = 0; i < n; i++) {
- printf("%d", *(arr+i));
- }
- } else {
- printf("n/a");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement