Guest User

Untitled

a guest
Oct 9th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #define N 100
  4.  
  5. void main(){  
  6.     int a,i;
  7.     char n;
  8.  
  9.     printf("Введите размер массива\n");
  10.     scanf("%d",&a);
  11.        if(a<0) return;
  12.        if(isalpha(a)) return;
  13.        if(a>N) return;
  14.  
  15.    
  16.     char Ni[a-1];
  17.  
  18.     for (i=0;i<a;i++){
  19.       scanf("%c",&Ni[i]);
  20.       n=Ni[i];
  21.       if(isdigit(n)) {
  22.  
  23.         n = n -'0';
  24.         n = 9- n;
  25.         n = n +'0';
  26.         Ni[i]= n;
  27.    
  28.                     } }  
  29.  
  30.     printf("Измененный массив");
  31.     for (i=0;i<a;i++)
  32.     printf("%c\n",Ni[i]);
  33.  
  34.     return;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment