下面是一段C程序,其功能为计算1到所输入数值的逐步累加和,请阅读程序并完成要求。
#include<stdio.h>
int sum(int);
void main( )
int num,k;
printf("Enter a number:");
seanf("%d",&num);
for(k=1;k<=num;k++)
printf("1 to %d is %d/n",k,sum(k));
int sum(int n)
int i,result=0;
for(i=1;i<=n;i++)
result+=i;
return result;
下面是一段C程序,其功能为计算1到所输入数值的逐步累加和,请阅读程序并完成要求。
#include<stdio.h>
int sum(int);
void main( )
int num,k;
printf("Enter a number:");
seanf("%d",&num);
for(k=1;k<=num;k++)
printf("1 to %d is %d/n",k,sum(k));
int sum(int n)
int i,result=0;
for(i=1;i<=n;i++)
result+=i;
return result;
听下面一段对话,回答下列问题。
听下面一段对话,回答下列问题。
听下面一段对话,回答下列问题。
W: Hi, Bill, can you tell me how it happened
M: Sure. I was mountain climbing in New Hampshire in 1982. Suddenly the weather became really bad. There was a lot of snow and we couldn’t see anything. We got lost. Well, we spent four days on the mountain. The temperature was 20 degrees below zero, We didn’t have any equipment or food.
W: So what happened I guess someone found you, right
M: Yes, but we were very sick. I couldn’t move my legs because of the cold. f spent two months in the hospital. The doctors removed my legs.
W: Right. So you lost your legs, but you want to try your best to stay active.
M: That’s right. In fact, I decided to make some new legs for myself. I realized that no one had to be physically disabled. We can use modern technology to help us.
W: And you built these great new legs. Can you go mountai
A. Design new climbing shoes.
B. Establish a club for the disabled.
C. Use technology to fight his disability.
听下面一段对话,回答下列问题。
听下面一段对话,回答下列问题。
W: Hi, Bill, can you tell me how it happened
M: Sure. I was mountain climbing in New Hampshire in 1982. Suddenly the weather became really bad. There was a lot of snow and we couldn’t see anything. We got lost. Well, we spent four days on the mountain. The temperature was 20 degrees below zero, We didn’t have any equipment or food.
W: So what happened I guess someone found you, right
M: Yes, but we were very sick. I couldn’t move my legs because of the cold. f spent two months in the hospital. The doctors removed my legs.
W: Right. So you lost your legs, but you want to try your best to stay active.
M: That’s right. In fact, I decided to make some new legs for myself. I realized that no one had to be physically disabled. We can use modern technology to help us.
W: And you built these great new legs. Can you go mountain climbing again
M:
A. Low temperature.
B. Terrible weather.
C. An unsuccessful operation.
下面是一段javabean程序,该程序的运行结果是()。
public class NullTest
public static void main(String[] args)
int M = 0;
String str = null;
StringBuffer sb = new StringBuffer("= ");
sb.append(str);
sb.append(M++);
System.out.println(sb.toString( ));
我来回答: