Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138751 田祥江 拆分分数 C++ Compile Error 0 MS 0 KB 215 2025-11-29 16:54:31

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int x,y,k; scanf("%d",&k); for(int x=k+1;x<=2*k,x++){ if((k*x)%(x-k)==0){ y=k*y/(x-y); printf("1/%d=1/%d+1/%d\n",k,x,y); } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:17: warning: left operand of comma operator has no effect [-Wunused-value]
  for(int x=k+1;x<=2*k,x++){
                 ^
Main.cc:6:26: error: expected ';' before ')' token
  for(int x=k+1;x<=2*k,x++){
                          ^
Main.cc:4:6: warning: unused variable 'x' [-Wunused-variable]
  int x,y,k;
      ^
Main.cc:5:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&k);
                ^