eror:lvalue required as left operand of assignment,
#include<stdio.h>intmain(){inta,b,ho,mi;scanf("%d%d",&a,&b);if(a%100+b>=0){ho=a/100+(...
#include <stdio.h>
int main()
{
int a,b,ho,mi;
scanf("%d %d",&a,&b);
if (a%100+b>=0)
{
ho=a/100+(a%100+b)/60,mi=(a%100+b)%60;
}
else
{
if (a%100+b>=(-60))
{
ho=a/100-1,mi=(a%100+b)+60;
}
else
{
if ((a%100+b)%60=0)//这里说eror:lvalue required as left operand of assignment
{
ho=a/100-1+(a%100+b)/60,mi=(a%100+b)%60;
}
else
{
ho=a/100-1+(a%100+b)/60,mi=(a%100+b)%60+60;
}
}
printf("%01d:%02d\n",ho,mi);
}
} 展开
int main()
{
int a,b,ho,mi;
scanf("%d %d",&a,&b);
if (a%100+b>=0)
{
ho=a/100+(a%100+b)/60,mi=(a%100+b)%60;
}
else
{
if (a%100+b>=(-60))
{
ho=a/100-1,mi=(a%100+b)+60;
}
else
{
if ((a%100+b)%60=0)//这里说eror:lvalue required as left operand of assignment
{
ho=a/100-1+(a%100+b)/60,mi=(a%100+b)%60;
}
else
{
ho=a/100-1+(a%100+b)/60,mi=(a%100+b)%60+60;
}
}
printf("%01d:%02d\n",ho,mi);
}
} 展开
1个回答
展开全部
判断是 == 不是= =是赋值, 然后前面的a%100+b>=0 我不知道+ 和判断 >=的优先级,但是觉得你最好加括号,if((a%100+b)>=0)
追问
else
{
if ((a%100+b)%60=0)//这里说eror:lvalue required as left operand of assignment 怎么弄啊
追答
改成 if ((a%100+b)%60==0)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询