一条鱼《···<

鲨鱼训练距离计算器

任务描述

本关任务:有这么一条大鲨鱼,为了保持健美的身材,每周除周六周日外游300公里来训练自己,如果从周一开始,过了b天后,它会训练多少公里呢?

输入b。b为天数。 输出为训练的公里数

测试说明

平台会对你编写的代码进行测试:

测试输入:7

预期输出:

1500

7表示过了7天。则训练了5天,所以输出为1500公里

#include<stdio.h>

int main()
{
	int b;
	scanf("%d",&b);
	int c=b/7;
	int d=b%7;
	
	
	if(d<=5){
		printf("%d",c*5*300+d*300);
	}else
	printf("%d",(c+1)*5*300);
	
	return 0;
	
}

以下是不同场景下实现一条鱼的代码示例: ### Python + Pygame 绘制鱼 ```python import pygame import math pygame.init() screen = pygame.display.set_mode((800, 600)) pygame.display.set_caption("Fish") clock = pygame.time.Clock() running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False screen.fill((0, 128, 255)) # 鱼的身体 pygame.draw.ellipse(screen, (255, 255, 0), (300, 250, 200, 100)) # 鱼的尾巴 points = [(500, 300), (550, 270), (550, 330)] pygame.draw.polygon(screen, (255, 0, 0), points) # 鱼的眼睛 pygame.draw.circle(screen, (255, 255, 255), (350, 300), 20) pygame.draw.circle(screen, (0, 0, 0), (350, 300), 10) pygame.display.flip() clock.tick(60) pygame.quit() ``` ### HTML + CSS + JavaScript 实现动画鱼 ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Fish Animation</title> <style> body { background-color: lightblue; margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; } .fish { position: relative; width: 200px; height: 100px; animation: swim 5s linear infinite; } .fish-body { width: 200px; height: 100px; background-color: yellow; border-radius: 50%; } .fish-tail { position: absolute; top: 25px; left: 180px; width: 0; height: 0; border-top: 25px solid transparent; border-bottom: 25px solid transparent; border-left: 50px solid red; animation: tail-wiggle 1s ease-in-out infinite alternate; } .fish-eye { position: absolute; top: 35px; left: 50px; width: 30px; height: 30px; background-color: white; border-radius: 50%; } .fish-eye::after { content: ""; position: absolute; top: 10px; left: 10px; width: 10px; height: 10px; background-color: black; border-radius: 50%; } @keyframes swim { 0% { transform: translateX(-500px); } 100% { transform: translateX(500px); } } @keyframes tail-wiggle { 0% { transform: rotate(-20deg); } 100% { transform: rotate(20deg); } } </style> </head> <body> <div class="fish"> <div class="fish-body"></div> <div class="fish-tail"></div> <div class="fish-eye"></div> </div> </body> </html> ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值