gpt4 book ai didi

c - 初学者 C 编程基础

转载 作者:太空宇宙 更新时间:2023-11-04 05:20:53 25 4
gpt4 key购买 nike

<分区>

下面的代码有问题

#include <stdio.h>
int main() /* Tidsberäkning YO */
{
float tid1, tid2;
printf("Tid i första åket? ");
scanf("%f", %tid1);
printf("Tid i andra åket? ");
scanf(%f", &tid2);
printf("Total Tid: %f\n", tid1+tid2);
printf(Genomsnittlig tid: %f\n", (tid1+tid2)/2);
}

这是错误日志

c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(6): error C2059: syntax error : '%'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2143: syntax error : missing ')' before '%'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2198: 'scanf' : too few arguments for call`
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2001: newline in constant
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2065: 'f' : undeclared identifier
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2143: syntax error : missing ';' before 'string'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): warning C4552: '%' : operator has no effect; expected operator with side-effect
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(9): error C2146: syntax error : missing ';' before identifier 'printf'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): error C2065: 'Genomsnittlig' : undeclared identifier
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): warning C4024: 'printf' : different types for formal and actual parameter 1
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): error C2146: syntax error : missing ')' before identifier 'tid'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): error C2017: illegal escape sequence
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): error C2001: newline in constant

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com