Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
竟如此简单#include <iostream> #include <cstring> using namespace std; char data[30]; int main() { while (true) { cin >> data; if (strcmp(data, "0+0=0") == 0) { cout << "True\n"; break; } int len = strlen(data); for (int i = 0; i < len / 2; i++) { int t = data[i]; data[i] = data[len-i-1]; data[len-i-1] = t; } int a, b, c; sscanf(data, "%d=%d+%d", &a, &b, &c); if (a == b+c) cout << "True\n"; else cout << "False\n"; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator