Promi_38

cf 1461A

Dec 16th, 2020
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main()
  5. {
  6.     int t;
  7.     scanf("%d", &t);
  8.     while(t--)
  9.     {
  10.         int n, k, i;
  11.         scanf("%d %d", &n, &k);
  12.         if(n % 3 == 0) for(i = 0; i < n/3; i++) printf("abc");
  13.         else if(n % 3 == 1)
  14.         {
  15.             for(i = 0; i < n/3; i++) printf("abc");
  16.             printf("a");   
  17.         }
  18.         else if(n % 3 == 2)
  19.         {
  20.             for(i = 0; i < n/3; i++) printf("abc");
  21.             printf("ab");  
  22.         }
  23.         printf("\n");
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment