主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1726
不连续1的子串 题解:(找规律)
lenny
VIP
回复 0
|
赞 0
|
浏览 654
本题与厦门大学机试题01字符串类似,也是考察到找数学规律 根据题意推理: 当n=1时 组合为0 1 共计2种 当n=2时 组合为00 10 01 共计3种 当n=3时 组合为000 100 010 001 101 共计5种 综上可以考虑此为斐波那契数列。 1...
P1240
首字母大写 题解:
dongqing
回复 0
|
赞 0
|
浏览 702
注意制表符'\t' 也需要大写 #include<bits/stdc++.h> using namespace std; int main(){ string s; while(getline(cin,s))...
P1040
利润提成 题解:
tianyz
回复 0
|
赞 0
|
浏览 1.1k
#include <bits/stdc++.h> using namespace std; int I, res; int main() { cin >> I; if (I <= 100000) res = I * 0.1; ...
P1043
计算Sn 题解:
tianyz
回复 0
|
赞 0
|
浏览 1.2k
#include <bits/stdc++.h> using namespace std; int a, n, res; int main() { cin >> a >> n; int c = a; for (int...
P1133
求1到n的和 题解:
tianyz
回复 0
|
赞 0
|
浏览 394
#include<bits/stdc++.h> using namespace std; int n, res; int main() { cin >> n; for ( int i = 1; i <= n; i ++) res += i; ...
P1091
促销计算 题解:
tianyz
回复 0
|
赞 1
|
浏览 944
#include <bits/stdc++.h> using namespace std; int main() { int x; while(scanf("%d", &x) != EOF) { double dis...
P1042
字符个数
dongqing
回复 0
|
赞 1
|
浏览 500
string s; getline(cin,s); 采用这种输入方式可以输入空格 #include<bits/stdc++.h> using namespace std; int main(){ string s; int zi...
P1437
日期类 题解:
dongqing
回复 0
|
赞 1
|
浏览 546
考虑特殊年份特殊day几种情况 #include<bits/stdc++.h> using namespace std; int main() { int m; int f[13]={0,31,28,31,30,3...
P1410
代码哪里有问题啊,总共也就做了十几道题至少有三道题了,试不出任何问题的代码提交就
983103231
回复 3
|
赞 0
|
浏览 9.0k
#include <iostream> #include <cmath> #include <cstring> using namespace std; int main() { int m, n; &nbs...
P1410
打印日期
dongqing
回复 0
|
赞 1
|
浏览 555
注意如何确定月份,用连续几个月份相加观察看看是否大于当前数字如果大于那么就是当前月份,日期用到目前位置的当前月份的总天数和减去当前月份的天数因为没有用完,用总天数减去刚计算的和 为实际day 注意输出的格式,注意判断闰年。 #include<bits/stdc...
P1290
日期差值 题解:分为两种情况 一种算年份一种不算年份
dongqing
回复 0
|
赞 1
|
浏览 647
总体解决思路是算出当前日期在本年的第多少天,同一年可直接相减,不是同一年要再加上年份限制。注意加1. #include<bits/stdc++.h> using namespace std; struct node { int y,m,d;...
P1011
日期 题解:注意最后输出的时候超过数组要除余
dongqing
回复 0
|
赞 1
|
浏览 529
#include<bits/stdc++.h> using namespace std; struct node { int y,m,d; }p; int main() { cin>>p.m...
P1253
合唱队形 题解:
fxl
回复 0
|
赞 1
|
浏览 656
#include <bits/stdc++.h> using namespace std; int n,a[105],dp_h[105],dp_t[105]; int main(){ while(cin>>n){ &nbs...
P1256
拦截导弹 题解:
fxl
回复 0
|
赞 1
|
浏览 447
#include <bits/stdc++.h> using namespace std; int n,dp[30],a[30]; int main(){ cin>>n; ...
P1012
字符移动 题解:
要一根华子
回复 0
|
赞 2
|
浏览 434
#include<bits/stdc++.h> #include <string> #include <algorithm> using namespace std; int main(){ char a[10...
P1002
数字统计 题解:
要一根华子
回复 0
|
赞 1
|
浏览 653
#include<bits/stdc++.h> using namespace std; int main(){ int L,R,count=0,temp; cin>>L>>R; for(int i=L;i...
P1257
最大上升子序列和 题解:
fxl
回复 0
|
赞 1
|
浏览 429
#include <bits/stdc++.h> using namespace std; int n,dp[1005],a[1005]; int LIS_sum(){ int ans=0; fo...
P1703
最大子串和 题解:
fxl
回复 0
|
赞 2
|
浏览 688
#include <bits/stdc++.h> using namespace std; int n,a[105],dp[105]; int main(){ while(cin>>n){ &nb...
P1334
最大连续子序列 题解:
fxl
回复 0
|
赞 1
|
浏览 402
#include <bits/stdc++.h> using namespace std; int k,a[10005],dp[10005]; int main(){ while(cin>>k){ ...
P1125
C语言海伦公式方法
nooknook
回复 2
|
赞 0
|
浏览 14.5k
#include<stdio.h> #include<math.h> int main() { int x0, y0, x1, y1, x2, y2; while (scanf("%d%d%d%d%d%d", &x0, &y0, &am...
P1726
不连续1的子串 题解:
fxl
回复 0
|
赞 1
|
浏览 323
#include <bits/stdc++.h> using namespace std; const int maxn=25; long long dp[maxn]; int main(){ int N; ...
P1347
基于大佬代码的更加清晰的版本(高强度注释)
mimicool
VIP
回复 0
|
赞 1
|
浏览 632
/* 我们假设会经过所有的加油站 我们可以假装持有价格高得油,一旦遇到价格低的就进行替换 在经过加油站的时候,我们补充该加油站的油(注意是假设补充,具体是否补充要看之后有没有遇见更加便宜的油) 比如,我们的油箱在遇到价值4快的加油站时,还剩下2块钱的油和5块钱的油,这说明之前假装补...
P1398
a+b - 华科 题解:
蟹蟹
回复 0
|
赞 1
|
浏览 468
#include<stdio.h> #include<math.h> #include<string.h> #define max 1010 int main() { void add(char a[],char b[...
P1399
排序 - 华科 题解:
蟹蟹
回复 0
|
赞 1
|
浏览 391
#include<stdio.h> int main() { int n=0,arr[105]; while(scanf("%d",&n)!=EOF){ // ...
P1911
反转公约数 题解:直接模拟即可
lenny
VIP
回复 0
|
赞 0
|
浏览 413
先对输入的数字进行反转,再使用gcd算法求公约数即可。 数字反转处理: 用一个临时变量存储第一个数字,使用%10来获得第一个数字 然后进行进位相加:res=res*10+a即可 最后还需要对x/=10操作,获取后几位数字 gcb求最大公约数: 递归求解 re...
P1479
01字符串 题解:(斐波那契数列换皮)
lenny
VIP
回复 0
|
赞 0
|
浏览 682
本题题意看似很难摸着头脑,实则这是一道斐波那契数列题的换皮。 根据题意可以自行推算 当n=1时,组合只有0 结果是1 当n=2时,组合:00 1 结果是2 当n=3时,组合:000 10 01 结果是3 当n=4时,组合:0000 100 010 001 11 结...
P1912
循环位移 题解:
lenny
VIP
回复 0
|
赞 1
|
浏览 386
#include <bits/stdc++.h> using namespace std; int size = 0; // 模拟字符串循环 void func(string &str1) { int len = str1.size(); // ...
P2020
字符串转化 题解:
ivannn
回复 0
|
赞 2
|
浏览 560
简化版本 #include <stdio.h> int main(){ char a[100]; int i=0,sum=0; while(scanf(...
P1394
三种情况:读取到字母、代表单词结束的空格、连续的空格
阔赛英
回复 4
|
赞 3
|
浏览 3.4k
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; int main() { char s[128]; whi...
P1476
查找学生信息2 题解:
peterzhou
回复 0
|
赞 2
|
浏览 654
#include <bits/stdc++.h> using namespace std; struct student{ string num; string name; string ...
1
...
56
57
58
59
60
...
126
我要提问
近期热门
1
N诺成就值出炉,帮你一眼识别大神
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
5
1377旋转矩阵
6
ip地址(C)
7
简单易懂
8
C++递归解法,有注释
9
1017 幂次方 快速幂模板
10
计算机考研复试笔记——操作系统篇