這個(gè)哪里錯(cuò)了啊 求大神指導(dǎo)!
#include <stdio.h>
? ?int j;
int sum(int x,int y)
{??
? ?if (0<x<5||x>=23)
? ?{
? ? ? ?if(y<3)
? ? ? ?{
? ? ? ? ? ?j=14;
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ?}
? ? ? ?else{
? ? ? ? ? ?j=14+(y-3)*2.3*1.2;
? ? ? ? ??
? ? ? ?}
? ?}
? ?else
? ?{
? ? ? ?if(y<3){
? ? ? ? ? ?j=14;
? ? ? ? ? ?
? ? ? ?}
? ? ? ?else {
? ? ? ? ? ?j=14+(y-3)*2.3;
? ? ? ? ? ?
? ? ? ?}
? ?}
? ?
}
int main()
{?
? ?int k=sum(9,12);
? ?int m=sum(18,12);
? ?printf("%f",k+m);
? ? return 0;
}
2019-02-06
那些//是修改的地方
2019-02-06
#include <stdio.h>
double j;
double sum(int x,int y)
{??
? ?if((0<x)&&(x<5)||(x>=23))//
? ?{
? ? ? ?if(y<3)
? ? ? ?{
? ? ? ? ? ?j=14;
? ? ? ?}
? ? ? ?else{
? ? ? ? ? ?j=14+(y-3)*2.3*1.2;
? ? ? ?}
? ?}
? ?else
? ?{
? ? ? ?if(y<3)
? ?{
? ? ? ? ? ?j=14;
? ? ? ?}
? ? ? ?else {
? ? ? ? ? ?j=14+(y-3)*2.3;
? ? ? ?}
? ?}
? ?return j;
}
int main()
{?
? ?double k=sum(9,12);//
? ?double m=sum(18,12);//
? ?printf("%f",k+m);
? ?return 0;
}