#include <stdio.h>
int main()
{
int w,x,y,z;
float v;
printf("Enter the driver salary\n");
scanf("%d",&x);
printf("Enter the car mileage in km per litre\n");
scanf("%d",&y);
printf("Enter the cost of petrol per litre\n");
scanf("%d",&z);
printf("Enter the taxi fare for a km\n");
scanf("%d",&w);
printf("Enter the distance of travel\n");
scanf("%f",&v);
if(w==200 && y==10 && z==60 && x== 20 && v==10.5)
printf("Minimal cost travel is by taxi\n");
else
printf("Minimal cost travel is by audi\n");
return 0;
}
对于两种不同的w
组输入值,y
,z
,x
,v
,我需要打印在同一时间两个输出语句。我获得第一个输出,但是如何同时获得两个输出?
删除'else',并把它一起下'if'?没有真正理解这个问题 – Ediac
你能更具体一些“两组不同的输入值”有点模糊,没有帮助。通常有帮助的是为给定的输入提供期望的输出,然后为该输入提供实际的输出。 – Daniel
请尝试多解释一下你的问题。 –