【发布时间】:2017-03-08 10:10:07
【问题描述】:
我正在努力学习编程。这是一个简单的问题,但我无法解决。 为什么我会收到错误消息?怎么了? 我怎么解决这个问题?请帮帮我。
这是问题定义和我的代码:
#include<stdio.h>
void calculateCharged(int c) {
int a;
int hours = scanf("%d", &a);
int totalFee = 25;
}
int main(void) {
int i;
int b;
printf("Please Enter Number of Cars ");
scanf("%d", &i);
for (b = 0; b < i; b++) {
calculateCharged(hours)
if (hours)<8
totalFee += hours * 0, 5
else if hours < 24
int additionalHours = hours - 7
totalFee += additionalHours * 5
totalFee += hours * 0, 5
else
int days = hours / 24
int extraHours = hours % 24
totalFee += days * 50
totalFee += days * 24 * 0, 5
totalFee += extraHours * 5
totalFee += extraHours * 0, 5
}
}
【问题讨论】:
-
请不要使用图像和 C/C++ 标记。请阅读how to ask。
-
这里有几百万个错误,你应该拿起一本关于 C 的书,猜测不是办法。
-
您会出错,因为您还没有学习该语言。 Please find a good beginners book 阅读,然后从更简单的内容重新开始。
-
Mert, aradığın cevabı bulduysan cevaplardan birini kabul etmelisin。 Sorunun puanının altındaki yeşil tik işaretine tıklayarak yapabilirsin bunu。
标签: c if-statement compiler-errors runtime-error