- 博客(11)
- 收藏
- 关注
原创 OJ 刷题HDU2036 改革春风吹满地 c++
OJ 刷题HDU2036改革春风吹满地 c++求坐标面积主要是一个坐标求面积公式比如三个点(x1,y1)(x2,y2)(x3,y3)S=|(x1y2+x2y3+x3y1)-(y1x2+y2x3+y3x1)|/2#include<iostream>#include<cmath>using namespace std;#include <iomanip&...
2019-10-18 16:45:45
259
原创 OJ刷题 HDU2017 字符串统计 c++
OJ刷题 HDU2017字符串统计 c++#include<iostream>#include<stdio.h>using namespace std;//#include "conio.h"int main(){ int n; cin>>n; getchar();//吃掉换行符 while(n--){ char ch; ...
2019-10-18 15:46:16
270
原创 OJ刷题 HDU2019 数列有序 c++
OJ刷题 HDU2019数列有序 c++比较简单的写法#include<iostream>using namespace std;//#include "conio.h"int main(){ int n,m; while(cin>>n>>m) { if(n==0&&m==0) break; int a[100]...
2019-10-18 15:09:50
270
原创 OJ刷题 HDU2035 人见人爱A^B c++
OJ刷题 HDU2035人见人爱A^B c++就是每次乘以后对1000取余这样结果才不会溢出也可以用快速幂,比较麻烦一点#include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b&&a!=0&&b!=0){ ...
2019-10-18 10:24:24
266
原创 OJ刷题 HDU2026 首字母大写 c++
OJ刷题 HDU2026 c++首字母大写我用的小写字母ASCII码值-32得到大写字母的方式#include<iostream>#include<string>//#include<ctype.h> //这个库里面有大小写转换函数using namespace std;int main(){ string str; while(ge...
2019-10-18 09:48:33
287
原创 OJ刷题 HDU2032 杨辉三角二维数组的运用 C++代码
OJ刷题 HDU2032 c++杨辉三角二维数组的运用#include<iostream>using namespace std;int main(){ int n; int a[30][30]; while(cin>>n){ for(int i=0;i<30;i++){ for(int j=0;j<30;j++){ a[i]...
2019-10-18 09:13:28
202
原创 OJ刷题 HDU2033 c++
OJ刷题 HDU2033 c++人见人爱A+B 水题#include<iostream>using namespace std;int main(){ int n; while(cin>>n){ while(n--){ int ah,am,as; int bh,bm,bs; int addH=0,addM=0,addS=0;//初始为0...
2019-10-18 08:22:45
290
原创 OJ刷题 HDU2030 c++
HDU2030 统计汉字字符tips:汉字字符都是1开头,是负数#include<iostream>#include<string>using namespace std;int main() { int n; while(cin>>n) { getchar();//getchar()函数 while(n--) { string st...
2019-10-17 14:57:26
308
1
原创 OJ刷题 HDU2029 c++代码简单解题
HDU2029 Palindromes _easy version回文字符对字符串的处理#include<iostream>#include<string>using namespace std;int main(){ int n; while(cin>>n){ while(n--){ string str; cin>>...
2019-10-17 14:34:51
296
原创 OJ刷题-HDU2028 C++最简单方法AC的解题代码
HDU2028 求n个数的最小公倍数数主要是定义求最小公倍数函数先求最大公约数int gcd(int a,int b){ if(a<b){ int t=a; a=b; b=t; } if(a%b==0) return b; else return(gcd(b,a%b))最小公倍数使用 lcm=a/gcd(a,b)*bint lcm(int a,int b){...
2019-10-17 11:18:36
381
原创 刷OJ的代码-HDU2023 c++代码
求平均成绩垃圾题目#include<iostream>#include<iomanip>using namespace std;int main(){ int n,m; while(cin>>n>>m){ int score[50][5]; int sum1=0,sum2=0; double averN[50],averM[...
2019-10-17 09:50:40
315
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人