Guest User

Untitled

a guest
Jul 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <cstring>
  5. using namespace std;
  6. #define LIMIT 100
  7. char buffer[LIMIT], * pos = buffer + LIMIT;
  8.  
  9. inline char getnext(){
  10.   if (pos == buffer + LIMIT){
  11.     pos = buffer;
  12.     fread(buffer, 1, LIMIT, stdin);
  13.   }
  14.   return *pos++;
  15. }
  16.  
  17. inline int getint(){
  18.   int num = 0;
  19.   char cc;
  20.   while (!isdigit(cc = getnext()));
  21.   do { num = num * 10 + cc - '0'; } while (isdigit(cc = getnext()));
  22.   return num;
  23. }
  24.  
  25.  
  26. int main()
  27. {int t=getint();
  28. while(t--){
  29.  int n=getint();
  30.  if(n%2==0)printf("%d\n",n);
  31.  else printf("%d\n",n-1);
  32. }
  33.    
  34. }
Add Comment
Please, Sign In to add comment