浙江大學c語言上機答案
❶ 求一些C語言上機程序題答案
有沒搞錯 我的原則:10分1道
❷ 求C語言程序設計習題集與上機指導-第三版 (及答案)......
大學學習資料免費下載網 有
在 其他公共課程 版塊
標題:
譚浩強《C程序設計題解內與上機指導》(電子書+紙質書容)
譚浩強編《C語言程序設計》(電子書word(txt)、pdf+紙質書)
譚浩強C語言程序設計習題參考解答
和配套 C程序設計題解與上機指導 答案
都有的 還有其他課程答案 (下載不用積分)
❸ 求C語言上機答案
參考代碼如下:
#include<stdio.h>
intmain(void)
{
intt,n,m,i,max[1000],min[1000],sn=0;
intflag,tmin,tmax;
scanf("%d",&n);
if(n<1|內|n>100)
return0;
while(n--){
scanf("%d",&m);
if(m<1||m>1000){
容printf("error");
continue;
}
flag=0;
for(i=0;i<m;++i){
scanf("%d",&t);
if(flag==0){tmax=tmin=t;flag=1;}
else{
tmax=t>tmax?t:tmax;
tmin=t<tmin?t:tmin;
}
}
max[sn]=tmax;
min[sn]=tmin;
sn++;
}
for(i=0;i<sn;++i)
printf("%d%d ",min[i],max[i]);
return0;
}
❹ 求C語言上機實驗題答案!!!
//1.將字元串中ASCII碼最小的字元放在第一個字元位置,其餘字元依次往後移
void func(char *str)
{
int loc=0,cloc=0;
char c;
c = *str;
while(*(str+loc) !='\0')
{
if( c>*(str+loc))
{
c = *(str+loc);
cloc = loc;
}
loc++;
}
while(cloc !=0) //移到最前
{
//左移
loc =0;
while(*(str+loc+1) !='\0')
{
c = *(str+loc);
*(str+loc) = *(str+loc+1);
*(str+loc+1) = c;
loc++;
}
cloc--;
}
}
//2.略去非數字字元,將字元串s轉換為一個整數
long func(char *s);
{
int loc=0;
char c;
long ret=0L;
......
......
//假設現在已經略去非數字字元,並取得+-,放於*str
while(*(str+loc) !='\0')
{
ret = ret*10 + (*(str+loc)-'0');
loc++;
}
if( c=='-')
ret *= -1;
return ret;
}
//3.返回在s中相鄰三個數的和中的最小值
int min3adj(int s[], int n)
{
int i,j;
long sum;
sum = s[0] + s[1] + s[2];
for( i=0; i <n-2 ;i++)
{
if( s[i] + s[i+1] + s[i+2] < sum )
sum = s[i] + s[i+1] + s[i+2];
}
return sum;
}
❺ 浙大今年c語言上機練習網址
10.71.45.100 你要先連內網哦
❻ c語言上機答案
1.main()
{char a;
scanf("%c",&a);
printf("%c%d",a-32,a-32);}
2.main()
{float c,f;
scanf("%f",&f);
c=5/9.0*(f-32);
printf("%f",c);
}
3.main()
{float x;
Y=3X3+0.4X2-2 X / 3;
printf("%f",Y);
}
4.main()
{int a,b,c,t;
scanf("%d,%d,%d",&a,&b,&c);
t=a;a=b;b=c;c=t;
printf("%d,%d,%d",a,b,c);
}
其它的你自己想想專吧屬