腾讯编程马拉松2012第一题
/*Sample code to read in test cases:*/ #include <stdio.h> #include <stdlib.h> #define NUM 1024 int main() { FILE * pFile; char mystring[NUM]; char sysInputFile[] = "{sysFileUrl}"; int sum; pFile = fopen(sysInputFile, "r"); sum=0; while (fgets(mystring, NUM, pFile)) { if (mystring == NULL) { continue;// Skip empty lines } else { sum+=atoi(mystring); } } printf("%d\n",sum); fclose(pFile); return 0; }