/* * @(#) msu97_x.c - Problem 'X' ("The super calculator") solution * of the ACM Programming Contest at the MSU in 1997. * (c) 1998 Ivan Maidanski http://ivmai.chat.ru * Freeware program source. All rights reserved. ** * Language: ANSI C * Tested with: Borland C++ v3.1 * Last modified: 1998-10-07 22:30:00 GMT+04:00 */ /* Input data file: x.dat */ #include /* FILE, fopen(), fscanf(), printf() */ int main() { FILE *f=fopen("x.dat","rt"); int n,s,v; char c; fscanf(f,"%*[^-0-9]%d%*[^\n]%*c",&n); while (0