Advertisement
MARSHAL327

Untitled

Nov 27th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <conio.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.     int length = 0;
  8.     int pospos = 0;
  9.     int posarrays[10] = {3,4,5,7,8,9,11,12,14,15};
  10.     int pos = posarrays[pospos];
  11.     char mask[17] = "+7(***)***-**-**";
  12.     printf("%s", mask);
  13.     while(length != 10){
  14.         int ch = getch();
  15.         if(ch >= '0' && ch <= '9'){
  16.             length++;
  17.             mask[pos] = ch;
  18.             system("cls");
  19.             pospos++;
  20.             pos = posarrays[pospos];
  21.             printf("%s", mask);
  22.         }
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement