sadiqul_amin

uva_nam jani na

Apr 8th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. #define SIZE 27
  4.  
  5. int T, N;
  6. char st[5];
  7. int Path[SIZE][SIZE];
  8. int Visited[SIZE];
  9. int Count;
  10.  
  11. void initCase()
  12. {
  13.     int i, j;
  14.     for (i=0; i<N; i++) for (j=0; j<N; j++)
  15.         Path[i][j] = 0;
  16.     for (i=0; i<N; i++)
  17.         Visited[i] = 0;
  18. }
  19.  
  20. void readCase()
  21. {
  22.     int x, y;
  23.     gets(st);
  24.     N = st[0] - 'A' + 1;
  25.     initCase();
  26.     while (gets(st)) {
  27.         if (st[0] == '\0')
  28.             break;
  29.         x = st[0] - 'A';
  30.         y = st[1] - 'A';
  31.         Path[x][y] = 1;
  32.         Path[y][x] = 1;
  33.     }
  34. }
  35.  
  36. void solveCase()
  37. {
  38. }
  39.  
  40. void printCase()
  41. {
  42.     printf("%d\n", Count);
  43.     if (T)
  44.         printf("\n");
  45. }
  46.  
  47. int main()
  48. {
  49.     freopen("input.txt", "r", stdin);
  50.     scanf("%d", &T);
  51.     getchar();
  52.     getchar();
  53.     while (T--) {
  54.         readCase();
  55.         solveCase();
  56.         printCase();
  57.     }
  58.     return 0;
  59. }
Add Comment
Please, Sign In to add comment