정보올림피아드 문제 풀다가 질문좀 올립니다
에드워드
질문 제목 : 위에모르게씀질문 내용 :
#include stdio.h
#include stdlib.h/* run this program using the console pauser or add your own getch, system(pause) or input loop */int main() {
char r[50];
char c[50];
char a[50];
char b[50];
char x[1]=x;
char m[1]=.;
file *fp;
int ra,ca,aa,ba;
int j,i;
int k=0;
//xx..xx..
//xx..xx..
//..xx..xx
//..xx..xx
fp = fopen(input.txt,r);
fscanf(fp,%d %d,&ra,&ca);
fprintf(fp,\n);
fscanf(fp,%d %d,&aa,&ba);
printf(r = %d \nc = %d \na = %d \nb = %d \n,ra,ca,aa,ba);
fclose(fp);
fp = fopen(output.txt,w);
for(i=1;i=ca;i++)
{
for(j=0;jba;j++)
{
b[k]=x[0];
printf(%d ,b[k]);
k++;
}
for(j=0;jba;j++)
{
b[k]=m[0];
printf(%d ,b[k]);
k++;
}
}
fclose(fp);
return 0;
}정보올림피아드 문제푸는중인데
알고리즘 짜는건 전혀 문제가 없는데저걸 문자열로 출력을 해야되는데
막상 출력되는걸 보면88 88 46 46 88 88 46 46이렇게 출력되네요;;문자열로 출력시키는 방법 없나요?
-
찬바리
itoa?