| ||||||||||
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 |
更优美的用库函数的方法GCC#include <stdio.h> #include <string.h> char str[100]; int main() { int n, a, b; scanf("%d%*c", &n); while(n--) { gets(str); sscanf(strrev(str), "%d%d", &a, &b); sprintf(str, "%d", a + b); sscanf(strrev(str), "%d", &a); printf("%d\n", a); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator