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 <stdio.h> int main ( int argc, char *argv[] ) { int a[2] = {0}; int f = 0; char buf[500] = {0}; scanf ( "%[^\n]", buf); char *p = buf; while(*p !='\0') { if(*p==' ') f++; else a[f] += *p-'0'; p++; } printf ( "%d\n", a[0]*a[1] ); return 0; } /* ---------- end of function main ---------- */ Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator