- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 1004 Financial Management
#include#includeusing namespace std;int main(){// freopen("in.txt","r",stdin);// freopen("out.txt","w",stdout); double in[12]; double sum = 0.00; for(int i=0;i<12;i++){ cin>>in[i]; sum
2016-06-11 11:41:39
354
原创 1106 Transmitters
向量的叉乘大于0即是在直线的同一边。#include#include#include#includeusing namespace std;struct point{ double x; double y;}p[1000],center;int tmax(int a, int b){ return a>b?a:b;}double dis(point a,po
2016-06-11 11:27:48
443
原创 1105 S-Trees
用二进制模拟#include#include#includeusing namespace std;int main(){// freopen("in.txt","r",stdin);// freopen("out.txt","w",stdout); int n; int count=0; while(cin>>n && n){ string s[8];
2016-06-11 11:26:26
454
原创 1028 Web Navigation
两个栈#include#include#includeusing namespace std; int main(){ freopen("input.txt","r",stdin); freopen("output3.txt","w",stdout); stacksb,sf; string in; string out; sb.push("http://www.a
2016-06-11 11:19:57
413
原创 1051 P,MTHBGWB
用两个map存储加密和解密信息。一个stack存储字符长度,加密时长度入栈,解密时长度出栈,符合先进后出。#pragma warning (disable : 4786)#include#include#include#include#includeusing namespace std;map morse;map remorse;stack num;void
2016-06-11 11:16:39
317
原创 1050 To the Max
最大子矩阵问题,转化成最大子段#include#includeusing namespace std;//最大子段和算法int MaxArray(int n, int array[]){ int sum=0; int max=-10000; for(int i=0;i<n;i++){ if(sum>0) sum+=array[i]; else sum=ar
2016-06-11 11:13:32
347
原创 1005 I Think I Need a Houseboat
#include#include#include#include#define pi 3.1415926using namespace std;int house(double r){ double squre=0; int year=0; while((r*r*pi/2)>squre){ squre+=50; year++; } return ye
2016-06-11 11:11:13
295
原创 1003 Hangover
#includeusing namespace std;float hang(int n){ float result=0; for(int i=0;i<n;i++){ result = result+(1/(n+1)); } return result;}int main(){ float in; cin>>in; int out; for(int i=1;
2016-06-11 11:09:43
306
原创 1007 DNA Sorting
使用sort()函数排序,sort(result_vec.begin(),result_vec.end(),Cmp()),自定义Cmp()的排序规则。用vector来存储字符串序列和对应的顺序的数值。本来想用map存储的,但是map的key唯一和自动排序会出问题。#include#include #include#include#includeusing namespace
2016-06-11 11:07:39
279
原创 1045 Bode Plot
公式不知道怎么推的。。。#include#include#includeusing namespace std;int main(){// freopen("input.txt","r",stdin);// freopen("output.txt","w",stdout); float Vs,R,C; cin>>Vs>>R>>C; int n; cin>>n;
2016-06-11 10:45:34
459
原创 1102 LC-Display
#include#includeusing namespace std;char** display(char c,int row,int column){ //分配二维数组 char **p = new char*[row]; for(int i=0;i<row;++i){ p[i] = new char[column]; } //初始化 for(int j=0;j<r
2016-06-11 10:42:25
652
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人