當前位置:首頁 » 編程語言 » 寧波大學c語言題庫

寧波大學c語言題庫

發布時間: 2022-05-07 14:04:08

① 大一c語言期末考試求題庫啊!

對呀,大多都是不一樣的,

② 誰有大一C語言考試題快考試了,跪求題庫··

單項選擇題(每小題2分,共50分)

1、一個C程序的執行是從___A__。

A、本程序的main函數開始,到main函數結束

B、本程序的main函數開始,到本程序文件的最後一個函數結束

C、本程序文件的第一個函數開始,到本程序文件的最後一個函數結束

D、本程序文件的第一個函數開始,到本程序main函數結束

2、C語言程序的基本單位是___C___。

A、程序行 B、語句

C、函數 D、字元

3、請選出可用作C語言用戶標識符的一組標識符___B___。

A、void B、a3_b3 C、For D、2a

define _123 -abc DO

WORD IF ase sizeof

主要特點

C語言是一種結構化語言,它有著清晰的層次,可按照模塊的方式對程序進行編寫,十分有利於程序的調試,且c語言的處理和表現能力都非常的強大,依靠非常全面的運算符和多樣的數據類型,可以輕易完成各種數據結構的構建,通過指針類型更可對內存直接定址以及對硬體進行直接操作,因此既能夠用於開發系統程序,也可用於開發應用軟體。

以上內容參考:網路-c語言

③ c語言題庫(適合大一計科新生的)怎麼找

每個學校應該有自己的OJ平台,如果沒有你可以去其他學校的OJ平台注冊然後刷題,網路搜索西安電子科技大學OJ、杭州電子科技大學OJ、西南電子科技大學OJ都可以

④ C語言題庫,求發一份

單選題
1. 以下敘述中正確的是(1)。
A.若e1、e2為變數,e為表達式,則
e1=e2=e使得e1、e2都具有表達式e的值 。


B.程序中不能定義與庫函數名同名的變數。
C.一個C源程序可放在多個文件中,但
一個函數不能跨放在兩個不同的文件中。
D.C語言編譯系統以函數為單位編譯源程序。

2. 若a,b,c都是實型變數,則下列語句中除 (2) 之外,都可能得不到正確的計算結果。
A.if(b*b-4*a*c==0) x1=x2=-b/(2*a);
else x1=(-b+sqrt(b*b-4*a*c))/(2*a), x2=(-b-sqrt(b*b-4*a*c))/(2*a);

B.b=2.0e38+1.0-2.0e38;
C.a=456*768/2;
D.double define=1.0;
3. 以下正確的常量是(3 )。
A.『077』 B.『\0x89』 C.3.14u D.『\012』
4. 若已有聲明「float x= -1234.5678; int m,n=4;」則執行「m=printf(「\n%8.3f\n」,x)/n;」語句後,
變數m的值是 (4) 。
A. 2 B. 3 C. 4 D. 5
5. 若已有聲明「int x1; float x2; long x3; char x4;」,且以下選項均出現在switch語句中,其中正確
的是 (5) 。
A. case 1.1: scanf("%d",&x1);break;
B. case 1+2: scanf("%f",&x2); break;
C. case 'x':
case 'y'-1: scanf("%ld",&x3); break;
D. case x4: scanf("%c",&x4); break;
6. 33.以下表達式中,能夠作為「if(e) 語句」中判斷條件表達式e 的是 (6) 。

A. x==++(x+1) B. x+=++x||x++ C. x+1=z D. x%2.0!=0
7. 以下局部變數聲明中,正確的是 (7) 。
A.int x=0, void=1; B.int x=1,y=2x;
C.int x=2,y=sqrt(x); D.int x=sqrt(y),y=4;
8. 在以下語句中,正確的是 (8) 。
A.if(a>b)m=a;n=b;else m=b;n=a;
B.if(a>b){m=a;n=b;else m=b;n=a;}
C.if(a>b)m=a,n=b;else m=b,n=a;
D.if(a>b){m=a;n=b;}else(a<=b){m=b;n=a;}
9.24.已知有聲明:「char c=『1』 ; int x=300 ; float t=35000 ; double d=3.1234567e10 ;」,則以下表達式
求值時除 (9 ) 外,其結果都可能是不準確的。
A.x=t/c B.t=d/x C.t=d/1e5f D. t=x+c
10.若有聲明「int i,k=1; unsigned j;」,則下列語句執行時會出現無限循環的語句
是 (10) 。

A.for(j=15;j>0;j-=2) k++;

B.for(j=0;j<15;j+=2) k++;

C.for(i=0;i<15;i+=2) k++;

D.for(i=15;i>0;i-=2) k++;

11.已有聲明「int x=2,y=1,z=0;」,以下表達式的值不為0的是 (11) 。
A. x==(x=0,y=1,z=2)
B. z>y>x
C. x>y==1
D. x>(y=2)

12.若e1、e2和e3是表達式,以下選項中與語句while(e1){e2,e3;}功能等價的語句是 (12 ) 。
A. for( ;e1;e3)e2; B. for( ;e1;e2)e3; C. for(e1;e2;e3); D. for(e1; e2, e3; );
13.已有聲明「int x=3;」,以下選項中與「x+=x =x+1」功能不等價的表達式是 (13 ) 。
A.x=x+(x=xx+1) B.x=x+(x=x(x+1)) C.x=x+(x=xx1) D.x=x(x+1), x=x+x
14.若已有聲明「int a=2; 」,則執行語句「printf("%d", a, a+1 );」後的輸出結果是 (14) 。
A.語法錯 B. 2,3 C. 2 D. 3
15.語句「if (!n) n++;」中的「!n」等價於如下 (15) 條件的判定。

A.n==0 B.n!=0 C.n>0 D.n<0
16.若已有聲明「int a=1; 」,則以下表達式中錯誤的是 (16 ) 。
A.-a++ B.+a-- C.--a D.++-a
17.下列 (17) C語言表達式能正確表達數學計算式1÷× 2xy。
A. 1/sqrt(2*3.14)*2*pow(x,y) B.1.0/sqrt(2)*2*x**y
C. 1.0/sqrt(6.28)*2x^y D.1/6.28^0.5*2*pow(x,y)
18. 已有聲明「int a=3,b=3,c=2;」,以下表達式中值為0的是 (18) 。
A. !a&&!b&&c B. !a || !b || c C. a==b &&b>=c D. a>=b &&b>c
19.
36.若有: int w=1 , x=2 , y=3 , z=4; 則表達式 w>x?x--:y<z?y--:++z 的值為 (19 ) 。

A. 4 B. 3 C. 2 D. 1
20. 已知某程序中有以下片斷:
#define p 2.5
main( )
{ float x=p;
}
則main函數中標識符p代表一個 (20) 。
A. float型變數 B. double 型變數 C. float型常量D.double 型常量
20.


填空題
1.21.設有如下程序段:
int a=2, b, c=5 ;
scanf( 「%d」 , &b) ;
b = c-- || scanf (「%d」 , &c ) && a++;
執行該程序段時,若從鍵盤上輸入的數據是 4ƀ3 (ƀ代表空格鍵) , 則變數c 的值為 (21) 。
2. signed和unsigned只能用於聲明int型變數和 (22) 型變數。
3.代數式「||」的C語言表達式是 (23) 。
4.已有聲明「int a=-13,n=7;」,表達式「a%=n%=4」求值後變數a的值為 (24) 。
5.已有聲明「unsigned int a=30; 」 ,那麼 –a 的值為___(25)____。

6.
如下程序執行後的輸出是____(26)____。
#include<stdio.h>
main ( )
{
int i=1,m=0;
switch ( i )
{
case 1 :
case 2 : m++;
case 3 : m++;
}
printf ( 「%d」 ,m);
}
7.C語言的三個邏輯運算符(!、&&、||)中,優先順序高於算術運算符的是
(27) 。
8.已知sizeof(int)的值為2,執行如下程序後輸出結果為 (28) 。
main()
{ int a,b;
a=65536;
b=32767+1;
printf("%d %d\n",a,b);
}
9.若有聲明「int a=3,b=0,c=5;」, 則表達式 !a+b+c-1&&b+c/2 的值是 (29) 。
10.若有聲明「int x=1,y=2;」 ,則表達式 ++x, x+y++ 的值是 (30) 。

三、閱讀程序題
1.在PC機的TC中執行以下程序後的輸出是: (31) 。

main()
{
unsigned x=0x7f39;

int y;
char c;

c=x;
x+=0307;
y=x;
printf(「%d,%x,%c」,x,y,c);
}
2.以下程序運行後的輸出結果是 (32) 。
#include<stdio.h>
main ( )
{ int x=30, y=45;
while(x!=y)
if(x>y)x-=y;
else y-=x;
printf("%d", x);
}
3.
以下程序運行後輸出結果的第一行是 (33) ,第二行是 (34) 。
#include<stdio.h>
#include<math.h>
void main()
{ int a=0x65,b,c,count=0;
b=a;
while(b>0)
{ b=b/8;
count++;
}
printf("%d\n",count);
while(count>0)
{ c=pow(8,count-1);
printf("%d",a/c);
a=a%c;
count--;
}
}
4.以下程序運行時輸出結果是 (35) 。
#include <stdio.h>
main()
{
int i,x=3,y=5;
for(i=0;i<3;i++)
switch(y%x)
{
case 0: printf("%d",y);
case 1: printf("%d",y--);break;
case 2: printf("%d",--y);break;
}
}

5.以下程序執行後,輸出結果的第一行是 (36) ,第二行是 _(37)______。
#define N 100
main()
{ int i=0,sum=0;
do
{ if(i==(i/2)*2)
continue;
sum++;
if(sum>3)
break;
}while(++i<N);
printf("%d \n %d", sum,i);
}

四、完善程序題

1.下列程序的功能是按從鍵盤上輸入的整數m,判斷2m -1是否為素數,若為素數再求2m -1的反序數。例如:m為17,217 –1(131071)是素數,其反序數是170131。
#include <stdio.h>
(38)
main()
{
int m,j;
long q,k1,k2=0,k3;
scanf("%d",&m);
k3=k1=pow(2,m)-1;
q=sqrt(k1);
for(j=2;j<=q;j++)
if( (39) ) break;
if(j>q)
{ while(k3>0)
{ k2=k2*10+ (40) ;
k3/=10;
}
printf("m=%d\npow(2,m)-1=%ld is a prime.\nreverse order %ld\n",m,k1,k2);
}
else
printf("m=%d isn't a prime.\n",m);
}
2. 以下程序找到並輸出所有滿足給定條件的四位十進製表示的正整數:該數是某個數的平方、該數的後二位是25、組成該整數的各位數字中有兩位是2。例如:1225是滿足所給條件的四位正整數(352=1225)。
#include<stdio.h>
#include<math.h>
main()
{ long i,j,s,d=0;
for(i=1000;i<10000;i++)
{ (41) ;
j= (42) ;
if(i==j*j && i%100==25)
{ s=i;
while(s>0)
{ if( (43) )d++;
s=s/10;
}
if(d==2) printf("\n %d",i);
}
}
}
3..下列程序計算下列數學函數展開式的近似值,累加運算在最後一項的絕對值小於10-6時停止。
程序運行時從鍵盤上分別三個實數-1.0、0.5、1.0,作為x的值。
#include <stdio.h>
#include <math.h>
#define EPS 1.0e-6
main()
{ double x,n,tn,ft,sn,xn;
int i;
for(i=0;i<3;i++)
{ (44) ;
ft=1.0;
scanf("%lf",&x);
sn=xn=x;
do{
xn=xn*x*x;
ft=ft*(2*n-3)/(2*n-2);
tn=ft*xn/ (45) ;
sn=sn+tn;
n=n+1;
}while( (46) );
printf("f(%lf)=%0.6lf\n",x,sn);
}
}

《C語言程序設計》試卷答題紙
(本試卷滿分100分)

系科_____________學號_____________姓名_____________成績____________

單項選擇題得分 填空題得分 閱讀程序題得分 完善程序題得分 總分

一 、單項選擇題

(1) (2) (3) (4) (5)
(6) (7) (8) (9) (10)
(11) (12) (13) (14) (15)
(16) (17) (18) (19) (20)

二、填空題

(21) (22)
(23) (24)
(25) (26)
(27) (28)
(29) (30)

三、閱讀程序題

(31) (32)
(33) (34)
(35) (36)
(37

四、完善程序題

(38) (39)
(40) (41)
(42) (43)
(44) (45)
(46)
《C語言程序設計》試卷參考答案
(本試卷滿分100分)

一 、單項選擇題

(1)C (2)D (3)D (4)A (5) B
(6)B (7)C (8)C (9)D (10)A
(11)C (12)A (13)A (14)C (15)A
(16)D (17)A (18)A (19)B (20)D

二、填空題

(21) 4 (22) char
(23) fabs(exp(sqrt(1+sin(x)))) (24) -1
(25) 65506 (26) 2
(27) ! (28) 0 -32768
(29) 1 (30) 4

三、閱讀程序題

(31) -32768, 8000, 9 (32) 15
(33) 3 (34) 145
(35) 4433 (36) 4
(37) 7

四、完善程序題

(38) #include <math.h> (39) k1%j==0
(40) k3%10 (41) d=0
(42) sqrt(i) (43) s%10==2
(44) n=2.0 (45) (2*n-1)
(46) fabs(tn)>EPS

⑤ c語言題庫

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dome2
{
class Student
{
public string name;
public float[] score=new float[3];
public float sum, avg;
public void InitScore()
{
this.sum = 0;
this.avg = 0;
}
public void GetScore()
{
Console.WriteLine("學員姓名:");
this.name = Console.ReadLine();
for (int i = 0; i < score.Length; i++)
{
Console.WriteLine("第{0}門的成績是:",i+1);
this.score[i] = float.Parse(Console.ReadLine());
}
Console.WriteLine();
}
public void GetSum()
{
for (int i = 0; i < score.Length; i++)
{
this.sum+=this.score[i];
}
this.avg = this.sum / 3;
}
public void DisplayScore()
{
Console.WriteLine("學員姓名:{0}", this.name);
for (int j = 0; j < 3; j++)
{
Console.WriteLine("第{0}門課程考試成績是{1}", j + 1, this.score[j]);
} Console.WriteLine("三門課程的總成績是{0},平均成績是{1}",this.sum, this.avg.ToString("0.00"));
Console.WriteLine();
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dome2
{
class Program
{
static void Main(string[] args)
{
Student[] student = new Student[5];
float max = 0,average = 0;
int i;
int counter = 0;
for (i = 0; i < student.Length; i++)
{
student[i] = new Student();
student[i].GetScore();
student[i].GetSum();
}
for (i = 0; i < student.Length; i++)
{
student[i].DisplayScore();
}
Console.WriteLine("");
Console.WriteLine("");
Console.WriteLine("");
Console.WriteLine("");
Console.WriteLine("========================================================");
for (i = 0; i < student.Length;i++ )
{
counter++;
max = student[i].sum + max;
average = student[i].avg + average;
}
Console.WriteLine("班級參加考試人數:{0} 最高分:{1} 平均分:{2}", counter, max, average);
}
}
}

⑥ C語言題庫訓練

#include<stdio.h>
int calc(int num){
int i,count=0;
for(i=1;i<=num;i++){
if(i%5==0||i%5==4){
count++;
}
}
return count;
}
void main(){
int num[4],i;
printf("Sample Input\n");
for(i=0;i<4;i++){
scanf("%d",&num[i]);
}
printf("\nSample Output\n");
for(i=0;i<4;i++){
printf("%d\n",calc(num[i]));
}
}

⑦ 求大一C語言期末考試題庫

我給你了,ok 記得採納

⑧ 浙大的PAT考試只能用C/C++嗎可不可以用JAVA

可以啊,網站上有介紹
考試主伺服器可以接受二十餘種編程語言,但各考場只保證提供C、C++、Java的程序編譯調試環境如下:
-- 杭州浙江大學玉泉考點:MS Visual Studio 2010 旗艦版, Eclipse (Kepler Release, Build id: 20130614-0229)
-- 杭州浙江大學紫金港考點:VC++ 6.0, C-Free 標准版, DEV-C++, Turbo C 2.0, Eclipse SDK
-- 寧波浙江大學寧波理工學院考點:VC++ 6.0, VS2010, Eclipse 3.7
-- 寧波浙江大學軟體學院考點:Eclipse 3.5.2, Visual Studio 6.0, TurboC 3.0
-- 福州福州大學考點:VC++ 6.0, VS2005, VS2008, Myeclipse 9, Myeclipse 10
-- 西安西安交通大學考點:VC++, VS2008, VS2012
-- 杭州臨安浙江農林大學考點:VC++ 6.0
-- 杭州下沙浙江傳媒學院考點:VC++ 6.0, VS 2005/2010, Eclipse
-- 煙台煙台大學考點:MS Visual Studio 2010 旗艦版, Eclipse 3.5.2, Visual Studio 6.0
-- 鄭州河南中醫學院信息技術學院考點:VC++ 6.0, MS Visual Studio 2010, Myeclipse 8
-- 青島青島大學信息工程學院考點:MinGW+codeblocks12.11, VC++6.0, jdk6+Eclipse Juno
-- 嘉興嘉興學院數理與信息工程學院考點:VC++ 6.0, VS2008, Myeclipse
-- 杭州浙江大學城市學院計算機與計算科學學院考點:VC++ 6.0,Eclipse V3.5.2
-- 南昌航空大學數學與信息科學學院考點:Win-TC,Dev-C++,VC++ 6.0,Eclipse SDK
-- 蘭州交通大學國家級計算機科學與技術實驗教學示範中心考點:Turbo C 2.0, VC++ 6.0, Eclipse SDK 3.41
-- 蘇州大學計算機科學與技術學院考點:VS2005, VS2010, Eclipse SDK 3.1

熱點內容
ct5推薦哪個配置 發布:2025-05-11 11:47:45 瀏覽:737
領購未上傳發票 發布:2025-05-11 11:43:27 瀏覽:716
查看華為雲伺服器的ip地址 發布:2025-05-11 11:24:44 瀏覽:235
長沙銀行密碼多少 發布:2025-05-11 11:24:38 瀏覽:671
緩存手機視頻合並軟體哪個好 發布:2025-05-11 11:22:30 瀏覽:698
伺服器c盤怎麼清除 發布:2025-05-11 11:16:33 瀏覽:39
動態估演算法 發布:2025-05-11 11:06:19 瀏覽:923
sql2008使用教程 發布:2025-05-11 10:53:16 瀏覽:315
正態分布函數c語言 發布:2025-05-11 10:50:38 瀏覽:396
分類投票源碼 發布:2025-05-11 10:46:23 瀏覽:782