#include <iostream>
using namespace std;
int main()
{
int a , b , c ;
while(cin>> a >> b >> c )
{
if((a/10)-(c/2)>=0)
{
b=b+c/2;
cout<< a << "個餅乾," << b << "盒巧克力," << c << "個蛋糕。" <<endl;
}
else
{
b=b+a/10;
cout<< a << "個餅乾," << b << "盒巧克力," << c << "個蛋糕。" <<endl;
}
}
return 0;
}
#include
using namespace std;
int main()
{
int a , b , c ;
while(cin>> a >> b >> c )
{
if((a/10)-(c/2)>=0)
{
b=b+c/2;
cout<< a << "個餅乾," << b << "盒巧克力," << c << "個蛋糕。" <<endl;
}
else
{
b=b+a/10;
cout<< a << "個餅乾," << b << "盒巧克力," << c << "個蛋糕。" <<endl;
}
}
return 0;
}
請大神幫忙,我真的不知道錯在哪
#include
using namespace std;
int main()
{
int a , b , c ;
while(cin>> a >> b >> c )
{
if((a/10)-(c/2)>=0)
{
b=b+c/2;
cout<< a << "個餅乾," << b << "盒巧克力," << c << "個蛋糕。" <<endl;
}
else
{
b=b+a/10;
cout<< a << "個餅乾," << b << "盒巧克力," << c << "個蛋糕。" <<endl;
}
}
return 0;
}
請大神幫忙,我真的不知道錯在哪
你的"個"和"盒" 前面沒有空格歐~