AAARI
AAARI
全部文章
题解
归档
标签
去牛客网
登录
/
注册
AAAI的写题笔记
欢迎,随便坐。
全部文章
/ 题解
(共5篇)
题解 | #HelloWorld#——一种运用三目运算符的解法
#include<iostream> #include<string> using namespace std; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++){ ...
2022-10-16
0
282
题解 | #LP钱不够#
#include<bits/stdc++.h> #define N 100 using namespace std; int a[N][N]; int dp[N][N]; int main(){ int t; scanf("%d",&t); while(t--){ i...
C
C++
2022-10-16
1
294
题解 | #s01串#
这道问题满足: 可以被划分为无数个相同且独立的子问题(考虑用递归) 可以找到最简单的解(考虑作为递归的出口) 建议画出递归树来帮助自己理解题意。 #include<stdio.h> void recur(int n){ if(n==0) printf("0"); if(n=...
C
2022-10-16
4
248
题解 | #杨辉三角#
需要注意题目所提供的目标三角形形状,若去掉下面代码中的注释,最后打印的三角形是对称的。 #include<stdio.h> #define N 100 int main(){ int n; scanf("%d",&n); int a[N][N]; for(int i=0;...
C++
2022-10-16
1
393
题解 | #字符串逆序#
最简单的思路:利用for循环结构将字符串逆序输出 具体做法参照代码: #include<stdio.h> #include<string.h> int main(){ char str[100]; int l=0; gets(str); l=s...
C
2022-10-16
0
222