Thursday, December 19, 2013

codechef DOUBLE - double strings solution

codechef DOUBLE - double strings: http://www.codechef.com/problems/DOUBLE/

editorial: http://discuss.codechef.com/questions/3696/double-editorial

my c++ solution to codechef DOUBLE - double strings: http://ideone.com/7Yh2kB
#include <iostream>
using namespace std;

int main() {
// your code goes here
int a, b;
cin>>a;
while(a--) {
cin>>b;
if(b%2) cout<<b-1<<endl;
else cout<<b<<endl;
}
return 0;
}

No comments:

Post a Comment