#include<stdio.h>
void main(){
int P[9] = {0};
int T[9] = {0};
int C = 532263;
int R = C;
int M = 10000;
int SW = 1;
for (int K=0; K<9; K++){
P[K] = R/M;
T[K] = T[K|+P[K];
R = R-(P[K]*M);
if (SW==1) {
M=M/2;
SW=0;
}
else {
M =M/5;
SW =1;
}
}
printf("만원");
printf("-----------------------");
for(int i = 0; i< 9; i++)
printf("%d",P[i]);
}
했는데
------------------Configuration: a11 - Win32 Debug--------------------
Compiling...
aaa.c
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(9) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(9) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(9) : error C2143: syntax error : missing ')' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(9) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(9) : error C2065: 'K' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(9) : warning C4552: '<' : operator has no effect; expected operator with side-effect
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(9) : error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(9) : error C2143: syntax error : missing ';' before '{'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(11) : error C2143: syntax error : missing ']' before ';'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(24) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(24) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(24) : error C2143: syntax error : missing ')' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(24) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(24) : error C2065: 'i' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(24) : warning C4552: '<' : operator has no effect; expected operator with side-effect
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(24) : error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\a11\aaa.c(25) : error C2146: syntax error : missing ';' before identifier 'printf'
Error executing cl.exe.
a11.exe - 15 error(s), 2 warning(s)
이런 오류뜸 왜그러는지 아는사람>?
c라서 에러 뜨는거임.
옛날 ANSI C에선 변수 정의 최상단에서밖에 못하지 않나
c문법인데 c 쓰면 안됨?
아 엤날 c라서 그런가보군;;