Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139911 芦睿霖 11石头剪刀布 C++ Compile Error 0 MS 0 KB 347 2025-12-11 21:12:22

Tests(0/0):


Code:

#include <iostream> using namespace std; int main(){ srand(time(0)) int r=rand() % 3 + 1; int p; cout<<"输入数字1-3:1: 石头 2:剪刀 3:布"; cin >> p; cout<<"随机数:" << r << endl; cout<<"判断人与计算机谁赢,谁输!!!"<<"computer:"<<r<<"player:"<<p; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:2: error: expected ';' before 'int'
  int r=rand() % 3 + 1;
  ^
Main.cc:11:24: error: 'r' was not declared in this scope
  cout<<"随机数:" << r << endl;
                        ^