程序出错/tmp/ccXYwCOL.o: In function `main': gukaixia5.c:(.text+0x19): undefined reference to `prinf
程序是:#include<string.h>#include<stdio.h>structBank{intUsed,Max;}bank[20];intmain(){int...
程序是:#include<string.h>
#include<stdio.h>
struct Bank
{
int Used,Max;
}
bank[20];
int main()
{
int flags=1;
int i,n,freemoney;
prinft("qingshuru kehushumu:");
scanf("%d",&n);
prinft("qingshuru yinhangjia nengtigongde yuanshidaikuanshumu:");
scanf("%d",&freemoney);
for(i=0;i<n;i++)
{
prinft("shuru kehu %dyishiyong dejine:",i);
scanf("%d",&bank[i].Used);
prinft("kehusuoxu de zuida daikuane:");
scanf("%d",&bank[i].Max);
freemoney=bank[i].Used;
}
for(i=0;i<n;i++)
prinft("%d %d\n",bank[i].Used,bank[i].Max);
for (i=0;i<n;i++)
if(bank[i].Max-bank[i].Used>freemoney){
prinft("not safe\n");
flags=0;
break;
}
else
{
flags=1;
freemoney+=bank[i].Max;
}
if(flags)prinft("safe\n");
return 1;
}
运行出错:怎么解决呢?
thtfpc@thtfpc-G31MXP-K-T1:~$ gcc gukaixia5.c
/tmp/ccXYwCOL.o: In function `main':
gukaixia5.c:(.text+0x19): undefined reference to `prinft'
gukaixia5.c:(.text+0x3a): undefined reference to `prinft'
gukaixia5.c:(.text+0x6d): undefined reference to `prinft'
gukaixia5.c:(.text+0x97): undefined reference to `prinft'
gukaixia5.c:(.text+0x109): undefined reference to `prinft'
/tmp/ccXYwCOL.o:gukaixia5.c:(.text+0x14e): more undefined references to `prinft' follow
collect2: ld returned 1 exit status 展开
#include<stdio.h>
struct Bank
{
int Used,Max;
}
bank[20];
int main()
{
int flags=1;
int i,n,freemoney;
prinft("qingshuru kehushumu:");
scanf("%d",&n);
prinft("qingshuru yinhangjia nengtigongde yuanshidaikuanshumu:");
scanf("%d",&freemoney);
for(i=0;i<n;i++)
{
prinft("shuru kehu %dyishiyong dejine:",i);
scanf("%d",&bank[i].Used);
prinft("kehusuoxu de zuida daikuane:");
scanf("%d",&bank[i].Max);
freemoney=bank[i].Used;
}
for(i=0;i<n;i++)
prinft("%d %d\n",bank[i].Used,bank[i].Max);
for (i=0;i<n;i++)
if(bank[i].Max-bank[i].Used>freemoney){
prinft("not safe\n");
flags=0;
break;
}
else
{
flags=1;
freemoney+=bank[i].Max;
}
if(flags)prinft("safe\n");
return 1;
}
运行出错:怎么解决呢?
thtfpc@thtfpc-G31MXP-K-T1:~$ gcc gukaixia5.c
/tmp/ccXYwCOL.o: In function `main':
gukaixia5.c:(.text+0x19): undefined reference to `prinft'
gukaixia5.c:(.text+0x3a): undefined reference to `prinft'
gukaixia5.c:(.text+0x6d): undefined reference to `prinft'
gukaixia5.c:(.text+0x97): undefined reference to `prinft'
gukaixia5.c:(.text+0x109): undefined reference to `prinft'
/tmp/ccXYwCOL.o:gukaixia5.c:(.text+0x14e): more undefined references to `prinft' follow
collect2: ld returned 1 exit status 展开
1个回答
2015-01-09
展开全部
应该是printf,不是prinft
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询