2772: 苹果和虫子 摘要:解题思路:每x小时吃掉1个苹果,n个苹果nx小时,nx-y是未吃掉的苹果的用时,(nx-y)/x是剩下的苹果。注意事项:都是提交成功过的,可以直接使用。参考代码:#include<iostrea…… 题解列表 2026年05月23日 0 点赞 0 评论 43 浏览 评分:0.0
函数嵌套jf语句 摘要:解题思路:注意事项:参考代码:def apple_number(n,x,y): if y>n*x: return …… 题解列表 2026年04月26日 0 点赞 0 评论 118 浏览 评分:0.0
编写题解 2772: 苹果和虫子 摘要:解题思路:向上取整注意事项:头文件#include <math.h>不要忘记,可以直接用ceil()函数实现向上取整。由于y和x都是整数,相除时得到的结果也是整型,那么向上取整就无法实现。…… 题解列表 2025年11月08日 1 点赞 0 评论 457 浏览 评分:10.0
2025.7.21刷题记录 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,x,y; scanf("%…… 题解列表 2025年07月21日 0 点赞 0 评论 299 浏览 评分:0.0
C++简单解法 摘要:解题思路:此题属于简单题,主要需要知道向上取整的函数ceil(),其他的基本都是基础知识注意事项:参考代码:#include<iostream>#include<cmath>#…… 题解列表 2025年03月03日 0 点赞 0 评论 513 浏览 评分:10.0
C语言 使用while循环解决问题 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main ( ){ int n=0 ,x=0 ;&nbs…… 题解列表 2025年01月02日 1 点赞 0 评论 520 浏览 评分:10.0
剩下的苹果的角度 摘要:解题思路:对于剩下的苹果,一是剩下都是完整的苹果,那么虫子吃的苹果为y/x;二是剩下的苹果中有一个是虫子没吃完的苹果,那么虫子吃的苹果为y/x+1,困为x/y会取整数,加上1,1是虫子没吃完的那个苹果…… 题解列表 2024年12月13日 2 点赞 0 评论 657 浏览 评分:10.0
编写题解 2772: 苹果和虫子 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n,x,y,sum=0; scanf("%d %d %d",&n,&x,&y); s…… 题解列表 2024年12月05日 0 点赞 0 评论 448 浏览 评分:0.0
不废话直接秒 摘要:解题思路:floor函数向下取整注意事项:参考代码:import mathn,x,y=map(int,input().split())print(math.floor(n-1/x*y))…… 题解列表 2024年11月30日 0 点赞 0 评论 621 浏览 评分:0.0
编写题解 2772: 苹果和虫子 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int x,y,n; cin>>n>>x>>y; if(y…… 题解列表 2024年11月24日 2 点赞 0 评论 497 浏览 评分:9.9