自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(51)
  • 收藏
  • 关注

原创 杭电acm2056 矩形重叠面积

刚开始直接找的坐标差,排序,求面积。 结果跟示例一样却不对#include<iostream>#include<iomanip>using namespace std;int main(){ double x1,x2,x3,x4,y1,y2,y3,y4,temp; while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4) {

2017-08-14 18:44:12 502

原创 杭电acm2026首字母大写

#include<iostream>#include<string.h>using namespace std; int main() { char ch[100]; bool flag=0; char f; while(gets(ch)) { int len=strlen(ch); f=ch

2017-08-14 00:59:47 300

原创 杭电acm2024 c语言合法标识符

所谓标识符,就是你起的一个名字。c/c++中,是你用来标识变量名、符号常量名、函数名、数组名、文件名、类名、对象名等的。(就好像你父母有了你以后给你起的名字)~~ c/c++有效标识符的构成规则如下 (1)第一个字符必须是字母(不分大小写)或下划线(_); (2)后跟字母(不分大小写)、下划线(_)或数字组成; (3)标识符中的大小写字母有区别。 (4)不能与c编译系统已经预定义的、具有特殊

2017-08-14 00:06:09 492

原创 杭电acm2022 海选

依旧用fabs()函数,建立二维数组比较。#include<iostream> #include<cmath>using namespace std;int main() { int a[50][50]; int i,j,n,m,t,x,y; while(cin>>n>>m) { if(n==0&&m==0) continue;

2017-08-13 20:13:58 471

原创 杭电acm2020 绝对值排序

有一个计算绝对值的函数的。。fabs()#include<iostream> #include<cmath>using namespace std; int main() { int a[100]; int i,j,n,t; while(cin>>n&&n!=0) { for(i=0;i<n;i++)

2017-08-13 19:23:44 403

原创 POJ 1001 高精度算法

没想到用这种模拟竖式的算法,膜大佬#include<iostream>#include<string.h>using namespace std; char str[10]; int n, dot; int res[999999], a[999999], b[999999]; int len, lena, lenb; void mul() { int i, j;

2017-08-13 15:44:35 252

原创 杭电acm2017 母牛生小牛

#include <iostream>using namespace std; int main(){ int n,s[100],i,sum; while(cin>>n&&n!=0) { s[0]=s[1]=s[2]=0; s[3]=1; for(i=1;i<n;i++) { s[3]=s[3]+s[2]; s[2]=s[

2017-08-13 02:01:52 449

原创 杭电acm2017 字符数量统计

字符这一块不太熟练,谨记#include<iostream>#include<string>using namespace std;int main(){ int n,len; cin>>n; string str; while(n--) { int num=0; cin>>str; len=str.si

2017-08-13 01:38:37 382

原创 杭电acm2012 素数判定

代码简单,谨此做一下记录#include<iostream>using namespace std;int cmd(int n){ for(int i=2;i*i<n;i++) { if(n%i==0) { return false; break; } } retur

2017-08-13 00:15:47 380

原创 杭电acm2000 ASCII码排序

如果你不嫌麻烦的话。。。#include<iostream>using namespace std;int main(){ char str1,str2,str3; while(cin>>str1>>str2>>str3) { if(str1>str2&&str2>str3) { cout<<str3<<" "<<

2017-08-12 19:08:44 234

原创 杭电acm1994 利息

简单,控制输出就好 c++语言:#include<iostream>#include<iomanip>using namespace std; int main() { int u; double n,Q,e,f,g; double ans1,ans2; cin>>u; while (u--) {

2017-08-12 18:48:42 238

原创 杭电acm 1877 求和+进制转换

很基础,构造一个比较函数就行了#include<iostream>using namespace std;int i=0;int ans[50];int cmp(long long c,int m){ if(c!=0) { ans[i]=c%m; c/=m; i++; return cmp(c,m);

2017-08-12 12:20:47 252

转载 杭电acm1862 EXCEL排序的实现

本人比较菜,至今还没有搞懂字典是怎么回事 查了大佬的结题报告,改成了C++语言 仔细看看是能够都明白的,就是简单的排序问题,被字典整蒙了。。。#include<iostream>#include <cstdio> #include <string.h> #include <algorithm> #define maxn 100005using namespace std; st

2017-08-12 11:26:49 458

原创 杭电acm1859 坐标长方形

就是找x,y最小最大的组合,分开找就好,注意判断输出#include<iostream> #include<algorithm> using namespace std; int x[100000], y[100000]; int main() { int i=0; while((cin>>x[i]>>y[i])&&(x[i]||y[i])) { i++

2017-08-12 11:05:12 274

原创 杭电acm1799 时间复杂度 杨辉三角。。。

杨辉三角。。见识一下 #include <iostream> #include <string.h> using namespace std; const int N = 2000; const int MOD = 1007; int c[N+1][N+1]; void initc() { c[0][0] = 1; for(int i=1;

2017-08-11 20:59:31 421

原创 杭电acm1785 求坐标夹角排序

百度一个函数atan2() atan2(y,x)就是与x轴的夹角弧度了#include<iostream> #include<cmath> #include<algorithm> using namespace std; struct person { double x; double y; double angle; }per[101]

2017-08-11 20:17:08 247

转载 杭电 acm 1720 输入16进制,输出10进制

一个有趣的东西 c 输入十六进制和八进制方法: scanf(“%x %x”,&a,&b); scanf(“%o %o”,&a,&b);c++ 方法: cin>>hex>>a>>b; cin>>oct>>a>>b; 输出与之类似 #include<iostream>using namespace std;int main(){ int a,b; while(cin>>

2017-08-11 18:29:39 221

转载 杭电ACM1718 名次

第一种方法,用排序#include <iostream> #include <string.h> using namespace std; long long a,b,c,d; long long num[107]; int main ( ) { while (cin>>a) { memset( num,0,sizeof(nu

2017-08-11 17:16:22 355

转载 杭电acm 1708 字符串相加再计数

#include <stdio.h> #include <string.h> int main() { int n, k, f[51][27], i, j; char str1[31], str2[31]; scanf("%d", &n); while (n--) { scanf("%s%s%d", str1

2017-08-10 01:22:11 337

原创 杭电ACM1587 买花,,气人

刚开始还以为是一种花只能买一朵。。。其实不然。。。 用set搞了半天。。#include<iostream>#include<set>using namespace std;int main(){ int n,m;//n种花,m元钱 while(cin>>n>>m) { int a[n],b[n],i,sum=0; for(int

2017-08-09 19:33:43 264

原创 杭电ACM 1465 不容易系列之一(错排)

只需要了解这个公式: 错排公式:f(n)=(n-1)*(f(n-1)+f(n-2)) #include<iostream>using namespace std;int main(){ long long a[20]={0,1,2}; int n,i; for(i=3;i<20;i++) { a[i]=i*(a[i-1]+a[i-2]);//错

2017-08-09 15:37:59 456

原创 杭电acm 1420 a^b%c

求解这道题要先知道这个公式,(a*a)%c=((a%c)*(a%c))%c 然后用降幂法,举例子具体说吧, 3^8=3^4*3^4=(3^2*3^2)(3^2*3^2)=((3*3)(3*3))((3*3)(3*3)),如果要求3^8%5,先求得3%5, 根据公式1就能依次求得3^2%5,3^4%5,3^8%5,这就是一个除2降幂的过程。 要注意的是某一次除2降幂可能幂变成奇数,这时要先拿

2017-08-09 01:44:47 275

原创 杭电acm 1418 (抱歉) 欧拉公式

知识点: 欧拉公式:面数+定点数-2=棱数。#include<iostream>using namespace std; int main() { long long n,m;//尽管输入数据都在32为整数范围内,但是相加有可能超出范围,用64位__int64或者long long型 while(cin>>n>>m) { if(n==0&

2017-08-09 01:13:55 215

转载 杭电acm 1412 {A}+{B}

这里运用了set 附上大佬set的用法:http://www.cnblogs.com/BeyondAnyTime/archive/2012/08/13/2636375.html 同时有相关的map的用法: http://blog.csdn.net/hero_myself/article/details/52313451#include <iostream> #include <set>

2017-08-08 23:39:06 319

原创 杭电acm 1365 数论

注意各种空格。。。 当n的值为1或偶数时,不存在x使得2^x mod n=1,其它情况则必存在一x使得2^x mod n =1。#include<iostream>using namespace std; int main(){ int x,n,t; while(cin>>n) { if(n==1||n%2==0) {

2017-08-07 20:45:57 240

原创 杭电acm1335 n进制转化m进制

【题意】 把十六进制以下的m进制转换为n进制; 1、第一个数是初始值,第二个数是初始进制,第三个数是要求转化的进制。 2、输出必须小于等于七位。否则输出ERROR。 3、把初始值转化为十进制数。原理:每位数字*初始进制^(位序-1)。 4、把十进制数转化为要求的进制数。原理:除N取余法#include<iostream>#include<string.h>#include<cmath>

2017-08-06 20:38:27 431

原创 杭电acm 1334 求立方

许多注意事项 记得空格比较烦 别的就没啥了#include<iostream>using namespace std;int main(){ for(int i=6;i<=200;i++) { for(int j=2;j<i;j++) { for(int k=j;k<i;k++) {

2017-08-06 19:20:08 252

原创 杭电acm 1408 挂盐水

#include <iostream> using namespace std; int main() { double VUL, D; int time, i, flag; while(cin >> VUL >> D) { time = 0; i = 1; flag = 0;

2017-08-03 22:41:13 427

原创 杭电acm1002 大数相加

#include<iostream>#include<string.h>#define MAX_LEN 40using namespace std;static int num=0;int an1[MAX_LEN+10];int an2[MAX_LEN+10];char Line1[MAX_LEN+10];char Line2[MAX_LEN+10]; int Add(int nM

2017-08-02 20:03:40 213

原创 杭电acm 1303 两倍

#include <iostream>using namespace std;int a[20] ;int ans ;int gao(){ int i, j, n ; int cnt = 0 ; ans = 0 ; while (cin>>n) { if (n == -1) return 0 ; if (n == 0)

2017-08-01 22:27:04 406 1

原创 杭电acm 1302 蜗牛爬井

#include<stdio.h> #include<string.h> int main() { double H,U,D,F; while(~scanf("%lf%lf%lf%lf",&H,&U,&D,&F) && (H||U||D||F)) { int day = 0; double distance

2017-08-01 20:17:21 637 1

转载 杭电acm 1283 模拟计算机

#include<stdio.h> #include<string.h> int main() { int r1,r2,r3; char a[300]; int j,k,l,i; int m1,m2; while(~scanf("%d%d",&m1,&m2)) {

2017-08-01 19:39:27 188

原创 杭电acm1282 回文数

#include <iostream> using namespace std; // 函数功能:判断参数n是否为回文数 // 参数n:需要判断是否为回文数的数 // 参数t:返回值,n的逆序数 bool isPalindrome(int n, int &t) { int temp1 = n; t = 0; while(n > 0) {

2017-08-01 19:02:41 568

转载 杭电acm1279 角谷猜想

#include <iostream> using namespace std; int main() { int n, m, count; cin >> n; while(n--) { cin >> m; count = 0; while(m != 1) { i

2017-08-01 17:42:35 294

转载 杭电acm 1266逆序输出

#include <cstdio> #include <cstring> int main() { int t; char s[117]; scanf("%d",&t); while(t--) { scanf("%s",s); int k = 0; int len =

2017-08-01 17:41:00 268

转载 杭电acm1236 排名

#include <iostream>  #include <cstdio>  #include <cstring>  #include <algorithm>  using namespace std;    class data  {  public:      char str[25];                    //考号      int sum;

2017-07-31 22:28:04 543

转载 杭电acm1235 求成绩相同的人数

#include <iostream> #include <stdio.h> using namespace std; const int N = 1000; int score[N]; int main() { int n, grade, cnt; while(scanf("%d", &n) && n) { for(in

2017-07-31 22:05:00 258 1

转载 杭电acm1234 开门人和关门人

#include<iostream>  //oj1234  #include<string>  #include<deque>  using namespace std;  int main()  {      int m,n,i;      deque<string> vec;      deque<string> ve;      string str,str1,str2;

2017-07-31 20:15:47 475

转载 杭电acm1219 统计字母出现次数

#include <stdio.h> #include <string.h> #define N 100001 int main() { char s[N]; int letter[26],i; while(gets(s)) { memset(letter, '\0', sizeof(letter))

2017-07-31 19:26:12 297

原创 杭电acm 1205 吃糖果

#include < stdio.h>int main (){ __int64 n,t,max,s,i,a; scanf("%I64d",&t); while(t--&&scanf("%I64d",&n)) { s=0; max=0; for(i=0;i<n;i++) { sc

2017-07-31 03:42:04 375

超融合架构与传统架构对比

超融合架构与传统架构对比

2023-08-31

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除