用for嵌套解决国王的烦恼——发工资(C语言) 摘要:简单的for嵌套是无法解决的,我们需要加入一些判断才能解决。#include<stdio.h> #include<stdlib.h> int main(){ int n,coins=0,day=…… 题解列表 2024年11月06日 0 点赞 3 评论 228 浏览 评分:9.9
找第一个只出现一次的字符 摘要:解题思路:写题解代码只是为了自己查看,无严谨性注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ char s[100000]; …… 题解列表 2024年11月06日 0 点赞 0 评论 418 浏览 评分:0.0
国王的烦恼——发工资,简单方法 摘要:解题思路:如果为6天,金币数为6-0+(6-0)-(0+1)+[(6-0)-(0+1)]-(0+1+1)=14,可推断出为n天时金币为(n-0)+(n-0)-(0+1)+[(n-0)-(0+1)]-(…… 题解列表 2024年11月06日 0 点赞 0 评论 182 浏览 评分:9.9
小白,看看就行,不动脑袋 摘要:解题思路:注意事项:参考代码:小白菜鸟写的,看看就好#include<iostream>using namespace std;int main(){ int arr[1000]; int…… 题解列表 2024年11月06日 0 点赞 0 评论 145 浏览 评分:0.0
Hello,World(C++代码) 摘要:#include<iostream> using namespace std; int main(){ return 0; }解题思路:无,上面的是标准头文件注意事项:几个星号需打参考代码…… 题解列表 2024年11月06日 4 点赞 0 评论 1015 浏览 评分:7.3
不一样的答案,新手必看 摘要:解题思路:新手都能看懂注意事项:放心食用参考代码:#include <stdio.h>int main() { int n,x,z; scanf("%d",&n); z=(n-2)*180; for…… 题解列表 2024年11月06日 0 点赞 0 评论 203 浏览 评分:9.9
字符逆序的简单写 摘要:解题思路:逆序就是,给字符或者数字一个长度,让它们呆在里面,换它们的位置如“hallo”,返回值为5,给这5个位置进行调换从而实现逆序 如“0123456789”,返回值为10,给这10位置进行调换从…… 题解列表 2024年11月06日 2 点赞 0 评论 416 浏览 评分:10.0
1019: [编程入门]自由下落的距离计算(用了一点点C语言) 摘要:解题思路:注意事项:参考代码:#include <iostream>#include <cmath>using namespace std; int main(){ double m,n; …… 题解列表 2024年11月06日 0 点赞 1 评论 256 浏览 评分:2.0
金币666简单算法 摘要:#include<stdio.h> int main(){ int i=1,d=0,n,s=0,c; scanf("%d",&n); while(d<n){ c=i; whi…… 题解列表 2024年11月06日 0 点赞 0 评论 168 浏览 评分:0.0
有稍微解释一下我的代码,但是没有说明数学逻辑 摘要:解题思路:注意事项:题目告诉我们的位置是在平面坐标系中的,所以我们要注意用距离公式【在c语言中,求a和b之间的距离x=sqrt(a*a+b*b)】去求大本营和某一个房顶之间的距离向上取整函数 ceil…… 题解列表 2024年11月07日 0 点赞 0 评论 193 浏览 评分:0.0