rock,scissors and paper
摘要:解题思路:这里根据3个string长度不同 就直接用int标记 封装一个判断函数 函数判断就三种结果 要么前面赢(8,5;4,8,;5,4;) 要不后面赢(这里复制一下就好了) 要不平局(s1.siz……
使用字典 win_rules 存储获胜规则且可扩展
摘要:def judge_game(player1_choice, player2_choice): """ 判断石头剪子布……
2025/8/11刷题记录
摘要:解题思路:strcmp比较两个字符串是否相等 相等输出0 s==“”这种写法不存在注意事项:参考代码:#include <stdio.h>#include <……
2849:石头剪刀布
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d",&n); char player1[……
2849: 石头剪子布
摘要:参考代码:n = int(input())
for _ in range(n):
S1, S2 = map(str, input().split())
if S1 == S2:
……
石头剪子布(Java)
摘要:解题思路:注意事项:参考代码:package arrLast;
//题目 2849: 石头剪子布
import java.util.Scanner;
public class t_2849 {
……
c代码记录之石头剪子布
摘要: #include
#include
int cq(char str1[],char str2[]){
if((str1[0]=='R'&&st……
石头剪子布(不难,就是麻烦)
摘要:解题关键:
strcmp() 字符串比较函数
头文件为#include
strcmp(s1,s2)
若s1==s2,则返回0
若s1>s2,则返回大于0的值
若s1……
2849: 石头剪子布(C语言)
摘要: #include
#include//主函数中使用了strcmp函数
int main()
{
int N;
scanf("%d",&N);
for(int i=0;i……