#include<stdio.h> int f(int n) { int i, j; int count; char str[100]; count = 0; for (i = 1; i <= n; i++) { sprintf(str, "%d", i); for (j = 0; str[j]; j++) { if (str[j] == '1') count++; } } return count; } int main() { int num,ans; puts("nの数は?"); scanf("&d",&num); ans = f(num); printf("ans=%d\n",ans); return 0; }
Standard input is empty
prog.cpp:5:1: error: stray ‘\343’ in program prog.cpp:5:1: error: stray ‘\200’ in program prog.cpp:5:1: error: stray ‘\200’ in program prog.cpp:7:1: error: stray ‘\343’ in program prog.cpp:7:1: error: stray ‘\200’ in program prog.cpp:7:1: error: stray ‘\200’ in program prog.cpp:9:1: error: stray ‘\343’ in program prog.cpp:9:1: error: stray ‘\200’ in program prog.cpp:9:1: error: stray ‘\200’ in program prog.cpp:10:1: error: stray ‘\343’ in program prog.cpp:10:1: error: stray ‘\200’ in program prog.cpp:10:1: error: stray ‘\200’ in program prog.cpp:11:1: error: stray ‘\343’ in program prog.cpp:11:1: error: stray ‘\200’ in program prog.cpp:11:1: error: stray ‘\200’ in program prog.cpp:11:1: error: stray ‘\343’ in program prog.cpp:11:1: error: stray ‘\200’ in program prog.cpp:11:1: error: stray ‘\200’ in program prog.cpp:12:1: error: stray ‘\343’ in program prog.cpp:12:1: error: stray ‘\200’ in program prog.cpp:12:1: error: stray ‘\200’ in program prog.cpp:12:1: error: stray ‘\343’ in program prog.cpp:12:1: error: stray ‘\200’ in program prog.cpp:12:1: error: stray ‘\200’ in program prog.cpp:13:1: error: stray ‘\343’ in program prog.cpp:13:1: error: stray ‘\200’ in program prog.cpp:13:1: error: stray ‘\200’ in program prog.cpp:13:1: error: stray ‘\343’ in program prog.cpp:13:1: error: stray ‘\200’ in program prog.cpp:13:1: error: stray ‘\200’ in program prog.cpp:13:1: error: stray ‘\343’ in program prog.cpp:13:1: error: stray ‘\200’ in program prog.cpp:13:1: error: stray ‘\200’ in program prog.cpp:14:1: error: stray ‘\343’ in program prog.cpp:14:1: error: stray ‘\200’ in program prog.cpp:14:1: error: stray ‘\200’ in program prog.cpp:14:1: error: stray ‘\343’ in program prog.cpp:14:1: error: stray ‘\200’ in program prog.cpp:14:1: error: stray ‘\200’ in program prog.cpp:14:1: error: stray ‘\343’ in program prog.cpp:14:1: error: stray ‘\200’ in program prog.cpp:14:1: error: stray ‘\200’ in program prog.cpp:14:1: error: stray ‘\343’ in program prog.cpp:14:1: error: stray ‘\200’ in program prog.cpp:14:1: error: stray ‘\200’ in program prog.cpp:15:1: error: stray ‘\343’ in program prog.cpp:15:1: error: stray ‘\200’ in program prog.cpp:15:1: error: stray ‘\200’ in program prog.cpp:15:1: error: stray ‘\343’ in program prog.cpp:15:1: error: stray ‘\200’ in program prog.cpp:15:1: error: stray ‘\200’ in program prog.cpp:16:1: error: stray ‘\343’ in program prog.cpp:16:1: error: stray ‘\200’ in program prog.cpp:16:1: error: stray ‘\200’ in program prog.cpp:17:1: error: stray ‘\343’ in program prog.cpp:17:1: error: stray ‘\200’ in program prog.cpp:17:1: error: stray ‘\200’ in program prog.cpp: In function ‘int main()’: prog.cpp:24:17: warning: too many arguments for format [-Wformat-extra-args]
Standard output is empty