编写题解 2772: 苹果和虫子 摘要:解题思路:向上取整注意事项:头文件#include <math.h>不要忘记,可以直接用ceil()函数实现向上取整。由于y和x都是整数,相除时得到的结果也是整型,那么向上取整就无法实现。…… 题解列表 2025年11月08日 1 点赞 0 评论 171 浏览 评分:10.0
C语言 使用while循环解决问题 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main ( ){ int n=0 ,x=0 ;&nbs…… 题解列表 2025年01月02日 1 点赞 0 评论 374 浏览 评分:10.0
剩下的苹果的角度 摘要:解题思路:对于剩下的苹果,一是剩下都是完整的苹果,那么虫子吃的苹果为y/x;二是剩下的苹果中有一个是虫子没吃完的苹果,那么虫子吃的苹果为y/x+1,困为x/y会取整数,加上1,1是虫子没吃完的那个苹果…… 题解列表 2024年12月13日 1 点赞 0 评论 504 浏览 评分:10.0
2772:苹果与虫子 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n,x,y; scanf("%d%d%d",&n,&x,&y); if(y%x==0) prin…… 题解列表 2022年12月07日 0 点赞 0 评论 941 浏览 评分:9.9
编写题解 2772: 苹果和虫子 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int x,y,n; cin>>n>>x>>y; if(y…… 题解列表 2024年11月24日 2 点赞 0 评论 359 浏览 评分:9.9
苹果和虫子 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,b,a,x; scanf("%d %d %d",&n,&b,&a); x=n-(a…… 题解列表 2024年11月07日 0 点赞 0 评论 334 浏览 评分:9.9
新手必看,苹果和虫子 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main(){ int n,x,y; scanf("%d %d %d",&n,&x,&y); int e=y/x; i…… 题解列表 2024年11月01日 0 点赞 0 评论 388 浏览 评分:9.9
我从不知何为败北,因为我家GeiGei无所畏惧,西内! 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,x,y; scanf("%d%d%d", &n, &x, &y); float a…… 题解列表 2023年06月01日 0 点赞 0 评论 486 浏览 评分:9.9
苹果和虫子C语言 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n,x,y; int d; float c; scanf("%d %d %d",&n,&…… 题解列表 2022年11月05日 0 点赞 0 评论 850 浏览 评分:8.0
比较简单理解的方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,x,y; scanf("%d %d %d",&n,&x,&y); if(y<=x*n){ n = n…… 题解列表 2023年09月22日 0 点赞 0 评论 622 浏览 评分:7.3