2013年愚人节的坑题。。。
呵呵,看完代码还是不知道这题是什么意思吧。好吧,提示关键字:美国总统。。。
AC代码如下:
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <algorithm> #include <iostream> #include <string> using namespace std; char a[][15]={"","Washington","Adams","Jefferson","Madison","Monroe", "Adams","Jackson","Van Buren","Harrison","Tyler", "Polk","Taylor","Fillmore","Pierce","Buchanan", "Lincoln","Johnson","Grant","Hayes","Garfield", "Arthur","Cleveland","Harrison","Cleveland","McKinley", "Roosevelt","Taft","Wilson","Harding","Coolidge", "Hoover","Roosevelt","Truman","Eisenhower","Kennedy", "Johnson","Nixon","Ford","Carter","Reagan", "Bush","Clinton","Bush","Obama"}; int main(){ int n; scanf("%d", &n); printf("%s", a[n]); return 0; }
B. QR codetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
InputThe input contains two integers a1, a2 (0 ≤ ai ≤ 32), separated by a single space.
OutputOutput a single integer.
Sample test(s)input1 1output0input3 7output0input13 10output1
又是一道不明所以的题,提示关键字:扫二维码。。。
二维码地址:http://tc-alchemy.progopedia.com/qr-code.txt
AC代码:
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <algorithm> #include <iostream> #include <string> using namespace std; char a[][35] = {"111111101010101111100101001111111", "100000100000000001010110001000001", "101110100110110000011010001011101", "101110101011001001111101001011101", "101110101100011000111100101011101", "100000101010101011010000101000001", "111111101010101010101010101111111", "000000001111101111100111100000000", "100010111100100001011110111111001", "110111001111111100100001000101100", "011100111010000101000111010001010", "011110000110001111110101100000011", "111111111111111000111001001011000", "111000010111010011010011010100100", "101010100010110010110101010000010", "101100000101010001111101000000000", "000010100011001101000111101011010", "101001001111101111000101010001110", "101101111111000100100001110001000", "000010011000100110000011010000010", "001101101001101110010010011011000", "011101011010001000111101010100110", "111010100110011101001101000001110", "110001010010101111000101111111000", "001000111011100001010110111110000", "000000001110010110100010100010110", "111111101000101111000110101011010", "100000100111010101111100100011011", "101110101001010000101000111111000", "101110100011010010010111111011010", "101110100100011011110110101110000", "100000100110011001111100111100000", "111111101101000101001101110010001"}; int main() { int x, y; scanf("%d %d", &x, &y); printf("%c\n", a[x][y]); return 0; }
C题的描述更是混沌一片,Google了半天,才发现了其中奥秘。提示关键字:LOLCODE。
做这道题之前首先要掌握LOLCODE语言的语法规则,然后就可以A了。
AC代码如下:
#include <cstdio> #include <cstring> #include<iostream> using namespace std; int main(){ int n; cin >> n; int foo = 0, bar = 0, baz = 0, quz = 1; for (int i = 0; i < n; i++) { int pur; cin >> pur; foo += pur; bar++; if (foo * quz > baz * bar) { baz = foo; quz = bar; } } cout << 1.0*baz/quz <<endl; }
根据图画过程编写程序。提示:蛇,心,手指什么的都是一个变量。
AC代码如下:#include <cstdio> #include <cstring> int main() { int n; char s[51]; scanf("%s %d", s, &n); int len = strlen(s); for (int i = 0; i < len; i++) { if (s[i] < 'a') s[i] += 'a' - 'A'; if (s[i] < 97 + n) s[i] += 'A' - 'a'; } printf("%s\n", s); return 0; }
Codeforces April Fools Day Contest 2013
最新推荐文章于 2024-02-19 10:14:07 发布