- 博客(24)
- 收藏
- 关注
原创 HDU1332LC-Display
HDU1332LC-Displayusing namespace std;#include<iostream>int main(){ int s,n,DATA[20],i,j,k,l; while(cin>>s>>n) { if(s==0&&n==0) break; int m = n; for(i=0;n;i++) { DATA[i]=n%10; n/=10; } if(m ==
2020-11-03 23:35:23 160 1
原创 HDU1106排序
HDU1106排序#include<iostream>#include<algorithm>using namespace std;int main(){ char num[1000]; int num1[1000]; while(cin>>num) { int flag = 0,len = 0,j=0; for(int i = 0;;i++) { if(num[flag]!=0) num1[i] =
2020-11-02 21:32:35 126
原创 HDU4011 Working in Beijing
HDU4011 Woking in Beijing(数据类型及数组大小的错误)using namespace std;#include<iostream>int main(){ int N,n,b,time[100010]; long long a; cin>>N; for(int j = 1;j<=N;j++) { cin>>n>>a>>b; long long sum= 0; for(int i = 0
2020-11-02 13:21:30 124
原创 HDU2708 Vertical Histogram
HDU2708 Vertical Histogramusing namespace std;#include<iostream>struct letter{ int num; char l;};int main(){ char c[4][80]; letter L[26]; while(gets(c[0])) { gets(c[1]); gets(c[2]); gets(c[3]); for(int i = 0;i<26
2020-11-02 01:09:17 116
原创 HDU2565放大的X
HDU2565放大的Xusing namespace std;#include<iostream>int main(){ int T,n; cin>>T; while(T--) { cin>>n; for(int i = 1;i<=n;i++) { if(i<=n/2) { for(int j = 1;j<=n-i+1;j++) { if(j == i||j ==
2020-11-01 20:49:47 3407
原创 HDU2153仙人掌
HDU2153仙人掌using namespace std;#include<iomanip>#include<iostream>int main(){ int N; while(cin>>N) { if(N == 0) break; int max = 4*N-4,n = N; for(int i = 0;i<N;i++) { for(int j = 0;j<N;j++) { if(
2020-11-01 20:11:41 67
原创 HDU2074叠筐(规律题)
HDU2074叠筐(规律题)#include<iostream>using namespace std;int main(){ char stuff,boder; int N,flag = 0; while(cin>>N>>stuff>>boder) { if(flag !=0)//*********注意两个叠筐间空一行 cout<<endl; flag=1; if(N == 1)
2020-11-01 14:57:20 160
原创 HDU1736美观化文字
using namespace std;#include<iostream>#include<cstring>int main(){ char str[9000]; while(gets(str)) { bool flag = true; int len = strlen(str); for(int i = 0; i<len ; i++) //不能是i<=len,会WA { string temp=""; te
2020-11-01 11:59:04 96
原创 multimap解决HDU1059:windows message Queue
multimap解决HDU1059:windows message Queue#include<iostream>#include<map>#include<string>using namespace std;struct information{ string A; int B;};int main(){ multimap<int,information>windows; multimap<int,information>
2020-10-29 21:14:48 101
原创 HDU1308AC代码
HDU1308AC代码#include<iostream>#include<string>using namespace std;int main(){ int day,month,year; while(1) { cin>>month>>day>>year; if(day==0&&month==0&&year==0) break; int m[13]={0,31,28,31,3
2020-10-25 14:40:10 73
原创 HDU1302 蜗牛AC代码
HDU1302 AC代码#include<iostream>using namespace std;int main(){ int H,U,D,F; cin>>H>>U>>D>>F; while(H!=0) { double reduce ,f = double(F)/100,sum = 0,u=U,d=D; int day = 1; reduce = f*u; whil
2020-10-18 16:23:24 102
原创 HDU1276 士兵队列训练AC代码
HDU1276 士兵队列训练AC代码1:不适用容器#include<iostream>using namespace std;void queue(int num){ int Q[5000]; for(int i = 0;i < num;i++) { Q[i] = i+1; } int peopleout = 0,signalnum,i1=1; while( peopleout+3 < num) {
2020-10-16 01:42:14 149
原创 航电oj1263,水果统计。水题记录
航电oj1263 水果(AC代码)using namespace std;#include<iostream>#include<string.h>struct fruit{ char name[100],location[100]; int num;};int main(){ int N,M; fruit f[100],temp; cin>>N; while(N--) { cin>>M;
2020-10-12 08:42:35 126
原创 航电oj1201 (18岁生日) 水题记录
航电oj1201 AC代码using namespace std;#include<iostream>bool leapyear(int x){ if((x%4 == 0&&x%100 != 0)||(x%100 == 0&&x%400 == 0)) return true; else return false; }int getyear(char *a){ int year=0; for(int
2020-10-12 08:28:09 120
原创 火车票购票系统 基于QT(C++)
buyer#ifndef BUYER_H#define BUYER_H#include<QString>class buyer{public: buyer(); void getinformation(QString n,QString i,QString s,QString e,int p); QString getname(); QString getidentify(); QString getstart(); QString
2020-10-12 00:43:31 4935 4
原创 航电oj1262(寻找素数组)的Time Limit Exceeded问题
航电oj1262的Time Limit Exceeded问题代码1:using namespace std;#include<iostream>bool prime(int n){ for(int i=2;i<n;i++) { if(n%i==0) { return false; break; } if(i == n-1) { return true; } }}int main(){ int M,minp1,minp2
2020-09-26 15:48:42 210
原创 HDU1259 ZJUTACM;光速AC
HDU1259 ZJUTACM;光速ACusing namespace std;#include<iostream>int main(){ int N; cin>>N; while(N--) { char card[7]={'Z','J','U','T','A','C','M'}; int swap,c1,c2; cin>>swap; for(int i=0;i<swap;i++
2020-09-26 13:25:02 79
原创 航电oj 1256 画8 AC代码
航电oj 1256 画8 AC代码using namespace std;#include<iostream>int main(){ int N; cin>>N; while(N--) { char c; int h,width1,middle,width2; cin>>c>>h; width1 = h/6+1; width2 = (h-2)/2; middle = (h+1)/2; for(int i=1;i&l
2020-09-26 11:50:18 222
原创 杭电oj 1201 AC代码(利用字符串解决)
哈哈using namespace std;#include<iostream>bool leapyear(int x){ if((x%4 == 0&&x%100 != 0)||(x%100 == 0&&x%400 == 0)) return true; else return false; }int getyear(char *a){ int year=0; for(int i=0;i<=
2020-09-25 14:24:31 122
原创 Accept today?HDU1177,水题记录:)
Accept today?HDU1177,水题记录:)using namespace std;#include<iostream>#include<algorithm>#include<string.h>struct joiner{ char time[90],accept[100]; int signal,p;};int main(){ int N,G,C,S,M; joiner j[130]; while(1) { cin>>
2020-09-24 14:14:00 151
原创 HDU 1170 balloon comes
##HDU1170 AC 代码using namespace std;#include<iostream>#include<iomanip>int main(){ int i,num1,num2,result; double result1; char c; cin>>i; while(i--) { cin>>c>>num1>>num2; switch(c){ case '+': result
2020-09-24 08:40:22 71
原创 航电oj1129 ac代码
航电oj1129 ac代码using namespace std;#include<iostream>#include<string.h>int main(){ int k,plaincode[100],secret_code[100]; char plaintext[100],secret_text[100]; cin>>k; while(k!=0) { int lenth; c
2020-09-24 01:11:22 161
原创 1234数字的全排列(不重复)
1234数字的全排列(不重复)#include<iostream>using namespace std;int main(){ int num[4]={1,2,3,4},i,j,k,sum=0,numafter[100],n=0; for(i=0;i<4;i++) { for(j=0;j<4;j++) { if(num[j]!=num[i]) for(k=0;k<4;k++) {
2020-09-11 14:59:08 3336
原创 HDU:1084AC代码
HDU:1804 AC代码using namespace std;#include<string.h>#include<iostream>int main(){ struct student{ int num; char T[9]; int score; }; int N,i,j=0,k; cin>>N; while(N>=0) { student S[100],temp[100],t;
2020-09-11 10:53:21 108
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人