| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2631 人关注过本帖
标题:求助!!!谁帮我把这几个题目做一下啊,做好的话把程序代码发到我的邮箱67 ...
只看楼主 加入收藏
煌的天空
Rank: 1
来 自:福建三明
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-1
收藏
得分:0 
回复 18楼 煌的天空
你们素质不是很好哦,本想试试你们的实力,没想到,素质那么差,你说没有交流对吧,你看:
T1分级+:
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include<math.h>

void main()
{
    int i,n;
    while(scanf("%d%*c",&n)!=EOF)
    {
    if(n<1000 && n>-1000)
        {
        if(n>=90) printf("A\n");
        else if(n>=80) printf("B\n");
        else if(n>=70) printf("C\n");
        else if(n>=60) printf("D\n");
        else if(n>=0) printf("E\n");
        else printf("Error\n");
        }
    }
}

T4提问+:
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include<math.h>

int* binSort(int array[],int n)//二分法插入排序
    {
    int *a,i,j,left,mid,right,temp;
    a=(int*)malloc(n*sizeof(int));//动态数组a
    if(a==NULL) {printf("out!");exit(0);}
    for(i=0;i<n;i++) a[i]=array[i];//不能破坏原始数组,所以做数组传值
    for(i=1;i<n;i++)
        {
        temp=a[i];left=0;right=i-1;
        while(left<=right)
            {
            mid=(left+right)/2;//mid指向查找范围中间,范围偶数时是中左一位置
            if(temp<a[mid]) right=mid-1;
            else left=mid+1;
            }
        for(j=i-1;j>=left;j--) a[j+1]=a[j];
        if(left!=i) a[left]=temp;
        }
    return a;
    }
void main()
{
    int i,n,a[2000],*b;
    while(scanf("%d*c", &n) != 0)
    {
        if(n==0) break;
        for(i=0;i<n;i++) scanf("%d%*c",&a[i]);
        b=binSort(a,n);
        for(i=0;;i++)
            {
            if(b[n-2]==a[i]) {printf("%d ",i+1,b[n-2]);break;}
            }
        for(i=0;;i++)
            {
            if(b[1]==a[i]) {printf("%d\n",i+1,b[1]);break;}
            }
    }
}
10
90 80 70 60 85 95 100 99 70 81
10
60 70 71 72 73 74 75 76 77 78
0

T7村会+:
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include<math.h>

void main()
{
    int a[100],n,m,i[100],j[100],k,ans;
    for(k=0;k<100;k++) a[k]=k+1;
    while(scanf("%d %d%*c",&n,&m)!= EOF)
    {
    for(k=0;k<m;k++)
        scanf("%d %d%*c",&i[k],&j[k]);
    for(k=0;k<m;k++)
        {
        ans=0;
        if(i[k]>n||j[k]>n||i[k]<1||j[k]<1) {printf("Error\n");continue;}
        while(1)
            {
            if(i[k]>j[k]&&i[k]) {i[k]/=2;ans++;}
            else if(i[k]<j[k]) {j[k]/=2;ans++;}
            else break;
            }
        printf("%d\n",ans);
        }
    }
}

T8奖金+:
#include "stdio.h"
#include "malloc.h"
#include "string.h"
#include "stdlib.h"
#include<math.h>
typedef struct SeqList * PSeqList;//指向班级集顺序表
typedef struct Student * PStudent;//指向一个班级
struct Student{int m;int *e;};//班级内结构,m为学生数
struct SeqList{int n;PStudent std;};//班级集顺序表结构,n为班级数

void main()
{
    int n,m,nb1=0,nb2=0,i,j;
    PSeqList bj;
    while(scanf("%d%*c",&n)!=EOF)
    {
    bj=(PSeqList)malloc(sizeof(struct SeqList));
    if(bj==NULL) {printf("out");exit(0);}
    else bj->n=n;
    bj->std=(PStudent)malloc(n*sizeof(struct Student));
    if(bj->std==NULL) {printf("out");exit(0);}
    for(i=0;i<n;i++)
        {
        scanf("%d%*c",&m);
        bj->std[i].e=(int*)malloc(m*sizeof(int));
        bj->std[i].m=m;
        for(j=0;j<m;j++)
            scanf("%d%*c",&bj->std[i].e[j]);
        }
    for(i=0;i<n;i++)//找出最大的两个
        {
        for(j=0;j<bj->std[i].m;j++)
            if(nb2<bj->std[i].e[j])
                {
                nb2=bj->std[i].e[j];
                if(nb1<nb2) {nb1+=nb2;nb2=nb1-nb2;nb1-=nb2;}
                }
        }
    for(i=0;i<n;i++)//重新定位置
        {
        for(j=0;j<bj->std[i].m;j++)
            {
            if(nb1==bj->std[i].e[j])
                {
                printf("Class %d: %d ",i+1,j+1);nb1=-1;
                }
            else if(nb2==bj->std[i].e[j])
                {
                    printf("Class %d: %d\n",i+1,j+1);nb2=-1;
                }
        //    if(nb2==nb1&&nb1==-1)
        //        exit(0);
            }
        }}
}

剩下的就你这高素质人才完成吧,主保佑你


2011-01-05 23:42
wujieru
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:1
帖 子:1108
专家分:1939
注 册:2010-10-9
收藏
得分:0 
剩下的就你这高素质人才完成吧,主保佑你
???????

楼主 你可否滚蛋??
2011-01-06 09:04
煌的天空
Rank: 1
来 自:福建三明
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-1
收藏
得分:0 
回复 23楼 wujieru
你都还没滚我怎么能走呢
2011-01-06 09:54
a343637412
Rank: 7Rank: 7Rank: 7
来 自:そ ら
等 级:黑侠
帖 子:357
专家分:620
注 册:2010-9-26
收藏
得分:0 




            0.0

            虽然当年我也是发作业贴起家的....但是...我给的分都是很多的....
                            (其实那时候一共也没为多少分....)
        ...
2011-01-06 10:13
shaohani
Rank: 1
等 级:新手上路
帖 子:9
专家分:5
注 册:2010-12-1
收藏
得分:0 
我刚来时要别人帮我做作业,结果净挨骂了,C语言要靠自己练习的,否则永远都学不好!
2011-01-06 19:49
vandychan
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
等 级:贵宾
威 望:18
帖 子:2296
专家分:6418
注 册:2010-8-20
收藏
得分:0 
楼主自己做出来 就不错了啊 加油吧

到底是“出来混迟早要还”还是“杀人放火金腰带”?
2011-01-06 19:52
xufan123
Rank: 5Rank: 5
等 级:职业侠客
帖 子:226
专家分:318
注 册:2010-11-15
收藏
得分:0 
练练手
2011-01-06 20:29
快速回复:求助!!!谁帮我把这几个题目做一下啊,做好的话把程序代码发到我的邮 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026871 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved