[Description]: calculate the average value based on the square in the upper left corner and the values in the lower right corner and lower right corner of the square. Then, place the result in the square.
[Analysis]: because numbers are connected together, the character array can only be stored with variable type.
For details, see the code:
// 216 K 0 Ms # include <iostream> using namespace STD; char map [10] [10]; char start [15], end [15]; int main () {int R, C; while (1) {CIN> Start; If (strcmp (start, "endofinput") = 0) break; CIN> r> C; for (INT I = 0; I <r; I ++) CIN> map [I]; // input character array! Accumulation! For (INT I = 0; I <R-1; I ++) {for (Int J = 0; j <C-1; j ++) {cout <(Map [I] [J] + map [I + 1] [J] + map [I] [J + 1] + map [I + 1] [J + 1]) /4-'0');} cout <Endl;} CIN> end;} return 0 ;}
Poj 2579 blurred vision (simple question)