HZNUOJ 2387 苏轼寻宝

原题网址:HZNUOJ--2022程序设计基础第二章作业 Pro

 解题思路:遍历每行每列就能找出来,发出来是因为当初困了我好几天。。。

其他题的答案懒得写题解了,有不懂的私信我吧~

#include <stdio.h>
int main()
{
int m,n;
int a,b;
int u,o;
int e;
int p,q;
int check=1;
scanf ("%d %d",&n,&m);
int str[100][100];
for (a=1;a<=n;a++)
{
for (b=1;b<=m;b++)
{
scanf ("%d",&str[a][b]);
}
}
for (a=1;a<=n;a++)
{
for (b=1;b<=m;b++)
{
if (str[a][b]<str[a][check]) check=b;
}
 for (e = 1; e <= n; e++)
{
if (str[a][check] < str[e][check])
break;
}
if (e== n + 1)
{
   u = a;
o = check;
   break;
  }
 }
a1: printf ("(%d,%d)",u,o);
return 0;
}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
好的,我会用turtle模块来绘制苏轼的贬谪狙击。 首先,我们需要导入turtle模块: ```python import turtle ``` 然后,我们需要设置画布的大小和背景颜色: ```python turtle.setup(800, 600) turtle.bgcolor("#F0EAD6") ``` 接着,我们定义一个函数来绘制苏轼的贬谪狙击: ```python def draw_su_shi(): turtle.speed(10) turtle.penup() turtle.goto(-200, 100) turtle.pendown() turtle.pensize(5) turtle.pencolor("#8B4513") turtle.fillcolor("#CD853F") turtle.begin_fill() turtle.circle(50) turtle.end_fill() turtle.penup() turtle.goto(-150, 150) turtle.pendown() turtle.write("苏", font=("Arial", 30, "normal")) turtle.penup() turtle.goto(-120, 100) turtle.pendown() turtle.write("轼", font=("Arial", 30, "normal")) turtle.penup() turtle.goto(-50, 50) turtle.pendown() turtle.pencolor("#8B0000") turtle.fillcolor("#FF0000") turtle.begin_fill() turtle.circle(50) turtle.end_fill() turtle.penup() turtle.goto(0, 100) turtle.pendown() turtle.write("贬", font=("Arial", 30, "normal")) turtle.penup() turtle.goto(50, 50) turtle.pendown() turtle.pencolor("#8B4513") turtle.fillcolor("#CD853F") turtle.begin_fill() turtle.circle(50) turtle.end_fill() turtle.penup() turtle.goto(100, 100) turtle.pendown() turtle.write("谪", font=("Arial", 30, "normal")) turtle.penup() turtle.goto(150, 50) turtle.pendown() turtle.pencolor("#8B0000") turtle.fillcolor("#FF0000") turtle.begin_fill() turtle.circle(50) turtle.end_fill() turtle.penup() turtle.goto(200, 100) turtle.pendown() turtle.write("狙", font=("Arial", 30, "normal")) turtle.penup() turtle.goto(250, 50) turtle.pendown() turtle.pencolor("#8B4513") turtle.fillcolor("#CD853F") turtle.begin_fill() turtle.circle(50) turtle.end_fill() turtle.penup() turtle.goto(300, 100) turtle.pendown() turtle.write("击", font=("Arial", 30, "normal")) ``` 最后,我们调用这个函数来绘制苏轼的贬谪狙击: ```python draw_su_shi() ``` 运行这份代码,你就能看到绘制出来的苏轼的贬谪狙击了。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值