Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136106 唐诗阳 百钱买百鸡II C++ Compile Error 0 MS 0 KB 545 2025-11-09 15:39:52

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int x,y,z,N,a=1; cin>>N; for(int x=0;x<=N;x++){ y=(N-7*x)/4; z=6*x+3*y; if(x>=0 && y>=0 && z>=0 && x+y+z=N){ cout<<a<<": "<<x<<','<<y<<','<<z<<endl; a++; } } if(a==1) cout<<"Nome"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:41: error: lvalue required as left operand of assignment
         if(x>=0 && y>=0 && z>=0 && x+y+z=N){
                                         ^
Main.cc:8:9: warning: unused variable 'x' [-Wunused-variable]
     int x,y,z,N,a=1;
         ^