上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: 错误点 (-0.005,0)上的数精确到小数点后两位时应是0而不是-0 注意点 cmath中的sin()和cos() 代码 #include <iostream> #include <cstdio> #include <cmath> #include <iomanip> using namespac 阅读全文
posted @ 2022-07-10 11:39 qwasdasd 阅读(36) 评论(0) 推荐(0)
摘要: 问题分解 数组倒序排列 指定正整数,求其两个最接近的因子m、n 顺时针螺旋矩阵打印 注意点 二维数组 代码 #include <iostream> #include <cstdio> #include <set> #include <vector> using namespace std; int 阅读全文
posted @ 2022-07-10 10:40 qwasdasd 阅读(31) 评论(0) 推荐(0)
摘要: 问题 cnt=cnt+a[i]*(i+1)*(n-i); 此处容易溢出,因此必须用long double 注意点 cout的格式化输出,iomanip cout<<fixed<<setprecision(2)<<cnt; 代码 #include <iostream> #include <cstdio 阅读全文
posted @ 2022-07-09 18:25 qwasdasd 阅读(35) 评论(0) 推荐(0)
摘要: 注意点 高位的0要舍去 所有位都是0的情况输出一个0 代码 #include <iostream> #include <cstdio> #include <string> using namespace std; char a[101]; char b[101]; int main(){ strin 阅读全文
posted @ 2022-07-09 17:32 qwasdasd 阅读(31) 评论(0) 推荐(0)
摘要: 注意点 输入为数字掺杂字符时,用scanf会比较方便 代码 #include <iostream> #include <cstdio> using namespace std; int a[1002]; int main(){ for(int i=0;i<1002;i++){ a[i]=0; } i 阅读全文
posted @ 2022-07-09 14:18 qwasdasd 阅读(28) 评论(0) 推荐(0)
摘要: 代码 #include <iostream> #include <cstdio> using namespace std; int main(){ int n; int a,b,c,d; int x=0,y=0; cin>>n; for(int i=0;i<n;i++){ cin>>a>>b>>c> 阅读全文
posted @ 2022-07-09 14:10 qwasdasd 阅读(24) 评论(0) 推荐(0)
摘要: 问题 测试点2格式错误,测试点2是0个可能的主元的情况,这里需要额外再加一个换行才能ac(原因不解) 思路 设置三个数组A、B、C,第一个数组A存放原本的排列,第二个数组B里的每个位置对应数组A相应位置向左的所有数的最大值,第三个数组C里的每个位置对应数组A相应位置向右的所有数的最小值。 再依次比较 阅读全文
posted @ 2022-07-09 13:52 qwasdasd 阅读(113) 评论(0) 推荐(0)
摘要: 问题 测试点2、3、4通不过,但是已经检验了多种特殊测试点,未发现问题 注意点 substr()的使用 map的使用 cin.sync()清空输入缓冲区 cin.getline()读取带空格的输入 字符串输入中带空格的情况 火星文中,如130的表示,只需要表示出高位数字,低位的0不需要显示 代码 # 阅读全文
posted @ 2022-07-09 10:47 qwasdasd 阅读(95) 评论(0) 推荐(0)
摘要: 代码 #include <iostream>#include <cstdio>#include <map>using namespace std;​​int main(){ char c; map<char,int> mp; mp['P']=0; mp['A']=0; mp['T']=0; mp[' 阅读全文
posted @ 2022-07-08 22:55 qwasdasd 阅读(20) 评论(0) 推荐(0)
摘要: 代码 #include <iostream>#include <cstdio>#include <string>#include <map>​using namespace std;​​int main(){ string a; int b,c; int m,n; int d; map<int,st 阅读全文
posted @ 2022-07-08 22:05 qwasdasd 阅读(128) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 下一页