电大2014年c语言程序设计a,2014年电大1253+C语言程序设计A(2010年1月)小抄参考.doc...

int SG(int x) { //x为大于等于2的整数

int a=(int)sqrt(x); //sqrt(x)取x的平方根

int i=2;

while(i<=a) {

if(x%i==0) break;

i++;

}

if(i<=a)return 0; else return 1;

}

函数功能:

2. int FindMax(struct IntNode *f) //f为一个单链表的表头指针

{

int x;

if(!f) {printf("单链表为空\n"),exit(1);}

x=f->data;

f=f->next;

while(f) {

if(f->data>x) x=f->data;

f=f->next;

}

return x;

}

假定struct IntNode的类型定义为:

struct IntNode { int data; struct IntNode* next;};

函数功能:

五、按题目要求编写程序或函数(每小题6分,共12分)

1. 编写一个程序,输出50以内(含50)的、能够被3或者5整除的所有整数。

2. 编写一个递归函数“int FF(int a[], int n)”,求出数组a中所有n个元素之积并返回。

参考答案

一、单选题(每小题2分,共20分)

1. D 2. A 3. C 4. D 5. C

6. C 7. B 8. D 9. A 10. D

二、填空题(每小题2分,共26分)

1. }(或右花括号) 2. 程序 3. 43 4. 7

5. y=y+1 6. 0(假) 7. 15 8. 数组

9. 连接 10. 25 11. (char*)p 12. 0

13. struct Worker* r

三、写出下列每个程序运行后的输出结果(每小题6分,共30分)

1. s=55

2. 2 8 21

3. 10

4. 2 3 5 8 13 21

5. 15 26

26 15

四、写出下列每个函数的功能(每小题6分,共12分)

1. 判断x是否为一个素数,若是则返回1,否则返回0。

2. 求出由f所指向的单链表中所有结点的最大值。

五、按题目要求编写程序或函数(每小题6分,共12分)

1. #includevoid main()

{

int i;

for(i=3; i<=50; i++)

if(i%3==0 || i%5==0) printf("%d ",i);

printf("\n");

}

2. int FF(int a[], int n)

{

if(n<=0) {printf("n值非法\n"),exit(1);}

if(n==1) return a[n-1];

else return a[n-1]*FF(a,n-1);

}

Winger Tuivasa-Sheck, who scored two tries in the Kiwis' 20-18 semi-final win over England, has been passed fit after a lower-leg injury, while Slater has been named at full-back but is still recovering from a knee injury aggravated against USA.

Both sides boast 100% records heading into the encounter but Australia have not conceded a try since Josh Charnley's effort in their first pool match against England on the opening day.

Aussie winger Jarryd Hayne is the competition's top try scorer with nine, closely followed by Tuivasa-Sheck with eight.

But it is recently named Rugby League International Federation player of the year Sonny Bill Williams who has attracted the most interest in the tournament so far.

The Kiwi - with a tournament high 17 offloads - has the chance of becoming the first player to win the World Cup in both rugby league and rugby union after triumphing with the All Blacks in 2011.

"I'd give every award back in a heartbeat just to get across the line this weekend," said Williams.The (lack of) air up there

Watch mCayman Islands-based Webb, the head of Fifa's anti-racism taskforce, is in London for the Football Association's 150th anniversary celebrations and will attend City's Premier League match at Chelsea on Sunday.

"I am going to be at the match tomorrow and I have asked to meet Yaya Toure," he told BBC Sport.

"For me it's about how he felt and I would like to speak to him first to find out what his experience was."

Uefa has opened disciplinary proceedings against CSKA for the "racist behaviour of their fans" during City's 2-1 win.

Michel Platini, president of European football's governing body, has also ordered an immediate investigation into the referee's actions.

CSKA said they were "surprised and disappointed" by Toure's complaint. In a statement the Russian side added: "We found no racist insults from fans of CSKA."

Baumgartner the disappointing news: Mission aborted.

The supersonic descent could happen as early as Sunda.

The weather plays an important role in this mission. Starting at the ground, conditions have to be very calm -- winds less than 2 mph, with no precipitation or humidity and limited cloud cover. The balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. It will climb higher than the tip of Mount Everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. As he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.

The balloon will slowly drift to the edge of space at 120,000 feet (

Then, I would assume, he will slowly step out onto something resembling an Olympic diving platform.

They blew it in 2008 when they got caught cold in the final and they will not make the same mistake against the Kiwis in Manchester.

Five years ago they cruised through to the final and so far history has repeated itself here - the last try they conceded was scored by England's Josh Charnley in the opening game of the tournament.

That could be classed as a weakness, a team under-cooked - but I have been impressed by the Kangaroos' focus in their games since then.

They have been concentrating on the sort of stuff that wins you tough, even contests - strong defence, especially on their own goal-line, completing sets and a good kick-chase. They've been great at all the unglamorous stuff that often goes unnoticed in the stands but not by your team-mates.

It is as though their entire tournament has been preparation for the final.

In Johnathan Thurston, Cooper Cronk, Cameron Smith and either Billy Slater or Greg Inglis at full-back they have a spine that is unmatched in rugby league. They have played in so many high-pressure games - a priceless asset going into Saturday.

The Kiwis are a lot less experienced but winning a dramatic match like their semi-final against England will do wonders for their confidence.

They defeated Australia in the Four Nations final in 2010 and the last World Cup, and know they can rise to the big occasion.

8

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值