HDU
鸡排饭,加个蛋
这个作者很懒,什么都没留下…
展开
-
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 · 223 阅读 · 0 评论 -
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 · 207 阅读 · 0 评论 -
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 · 220 阅读 · 0 评论 -
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 · 191 阅读 · 0 评论 -
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 · 246 阅读 · 0 评论 -
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 · 157 阅读 · 0 评论 -
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 · 242 阅读 · 0 评论 -
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 · 228 阅读 · 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 · 249 阅读 · 0 评论 -
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)*b int lcm(int a,int b){ ...原创 2019-10-17 11:18:36 · 348 阅读 · 0 评论