软件工程马搏

软件工程马搏 : KL排序
3 年,9 月前

include const int MAX_K = 11; const int MAX_N = 201; using namespace std; typedef struct _Tset { int order, sum; //记录顺序与总和 double klx; //记录计算得到的KL值 double label[MAX_K]; //以数组记录:基本数据+1/K }Tset; int cmp(const void a, const void b) { ...查看全文
软件工程马搏 : 保留位数
3 年,9 月前

include include iomanip using namespace std; int main(void) { int a,b; double c; while(cin>>a>>b) {c=sqrt(a a+b b); cout<<setprecision(3)<<fixed<<c<<endl; } } ...查看全文
软件工程马搏 : 最小公倍数
4 年前

include include long long num(long long a,long long b) { long long c; while (b!=0) { c=a%b; a=b; b=c;} return a; } int main() { int T,i; long long a,b; scanf(“%d”,&T); for(i=0;i<=T-1;i++) {scanf( ...查看全文
软件工程马搏 : 冒泡排序
4 年前

include int main() { int n,z; scanf(“%d”,&n); int data[n]; for(z=0;z<=n-1;z++) {scanf(“%d”,&data[z]);} int tmp; int i, j; for ( i = 0 ; i < sizeof ( data ) / sizeof ( int ) - 1 ; i ++ ) { for ( j = ...查看全文
软件工程马搏 : 拜访朋友
4 年前

include include int main() { int m,t,n,i,j,s,a[501],c; scanf(“%d”,&m); for (t=0;t<m;t++) { s=0; scanf(“%d”,&n); for (i=0;i<n;i++) scanf(“%d”,&a[i]); for (i=0;i<n-1;i++) ...查看全文
软件工程马搏 : 日历
4 年前

include void main() { int y,m,d,n; int a[13],i,sum1,sum2,sum; scanf(“%d%d%d”,&y,&m,&d); sum1=0;sum2=d;sum=0; for(i=1900;i<y;i++) { if(i%4==0&&i%100!=0||i%400==0) n=366; else n=365; sum1=sum1+n; //每年天数和 } if(y%4==0&&y%100!=0||y%400==0) ...查看全文
软件工程马搏 : 判断回文
4 年前

include int is_reverse(char s) { char p = s; while( p) p++; p–; while(p>s) { if( p != *s) break; p–; s++; } return p<=s; } int main() { char str[80]; gets(str); if(is_re ...查看全文
软件工程马搏 : 大整数相加
4 年前

include include define max(a,b) (a>b)?(a):(b) void add(char a,char b,char *c); int main() { char a[500],b[500],c[500]={0,}; while(~scanf(“%s %s”,a,b)){ add(a,b,c); printf(“%s\n”,c); } return 0; } void add ...查看全文
软件工程马搏 : 约瑟夫
4 年前

include int main(void) { int count, i, m, n, no; int num[50]; int p; scanf(“%d%d”, &n, &m); for(i = 0; i < n; i++) num[i] = i + 1; p = num; / --------- / num[i]=i+1; count=no=1; while(no!=n){ if(count==m){ printf(“No%d: %d\n”, no, p); no ...查看全文