张恒201901071908504
张恒201901071908504
全部文章
分类
未归档(1)
题解(38)
归档
标签
去牛客网
登录
/
注册
张恒的博客
全部文章
(共42篇)
题解 | #尼科彻斯定理#
题目的意思是已知等差数列和 图片说明 为 图片标题 ,项数n为m,公差d为2,求首项a1 #include<stdio.h> #include<string.h> int main(int argc, char const *argv[]) { int m = 0;...
C
2021-10-08
10
854
题解 | #输入整型数组和排序标识,对其元素按照升序或降序进行排序#
神奇的输入输出,tm还必须是最外层套一个while #include<stdio.h> int main(int argc, char const *argv[]) { int num = 0, sflag = 0, ntmp = 0, stmp = 0; while...
C
2021-09-28
5
806
题解 | #公共子串计算#
参考了:公共字串计算(最长公共子串/序列) #include <stdio.h> #include <string.h> #define MAX_STR 1024 //暴力破解 写三个for循环 两个遍历字符串 一个确定子串长度 int main(int argc, ...
C
2021-09-23
4
554
题解 | #参数解析#
#include<stdio.h> #include<string.h> /**第一步 设置tagFl=1,如果遇到空格则替换成换行符,并计数并跳过循环。否则将值赋值给新数组 * 第二步 如果遇到"则置tagFl=0遇到空格则不替换成换行符。 * 第三步 只到...
C
2021-09-17
0
585
题解 | #完全数计算#
纯C暴力破解,双循环解决 #include<stdio.h> int main(int argc, char const *argv[]) { int n = 0, sum = 0, number = 0; while (scanf("%d", &a...
C
2021-09-16
0
587
题解 | #配置文件恢复#
借鉴了这位老哥的思路:地址 #include<stdio.h> #include<string.h> #include <stdlib.h> #define MAX_CHAR 100 void out_tmp(int index); char *cmd1[6...
C
2021-09-14
0
415
题解 | #杨辉三角的变形#
引用的思路是题解场另一大佬的思路原链接 #include<stdio.h> //杨辉三角规律 行号 第一个偶数在该行第几个 // 1 ...
2021-08-17
0
395
题解 | #统计每个月兔子的总数#
#include<stdio.h> int fib(int a); int fib_arr(int a, int *arr); /** * 有一只兔子,从出生后第3个月起每个月都生一只兔子, * 小兔子长到第三个月后每个月又生一只兔子,假如兔子都不死,问每个月的兔子总数为多少? ...
2021-08-02
0
479
题解 | #字符串反转#
为什么我这样写就测试不通过呢? #include<stdio.h> #include<string.h> int main(){ int i=0; char str[999+1]; scanf("%s", str); i ...
2021-07-20
1
457
题解 | #查找输入整数二进制中1的个数#
PS:题干中说明注意多组输入。写的时候要注意一下,不能只取一个数。 #include<stdio.h> int main(){ int a=0, sum=0; while(scanf("%d", &a) != EOF){ sum...
2021-07-20
0
413
首页
上一页
1
2
3
4
5
下一页
末页