网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
以下程序的运行结果是()。includemain(){st,uct date {int year,month,day;}today; pri

以下程序的运行结果是( )。 #include <stdio.h> main() { st,uct date {int year,month,day;}today; printf("%d\n",sizeof(struct date)); }

A.6

B.8

C.10

D.12


参考答案

更多 “ 以下程序的运行结果是()。includemain(){st,uct date {int year,month,day;}today; pri 以下程序的运行结果是( )。 #include <stdio.h> main() { st,uct date {int year,month,day;}today; printf("%d\n",sizeof(struct date)); }A.6B.8C.10D.12 ” 相关考题
考题 有以下程序: Class Date { public: Date(int y,int m,mt d); { year=y; month=m; day=d; } Date(int y=2000) { year=y; month=10; day=1; } Date(Date D) { year=d.year; month=d.month; day=d.day; } Void prinA.2B.3C.4D.5

考题 下列程序的运行结果是()。 include main() {stmct date {int year,month,day; }today; 下列程序的运行结果是( )。#include<stdio.h>main(){stmct date{int year,month,day;}today;primf("%d\n",sizeof(struct date));}A.8B.6C.10D.12

考题 下列程序的运行结果为() include main() {struc tdate {int year,month,day; )today; 下列程序的运行结果为( )#include<stdio.h>main(){ struc tdate{int year,month,day;)today;printf("%d\n",sizeof(struct date));}A.8B.6C.10D.12

考题 有以下程序:class Date{public:Date(int y,int m,int d);{year=y;month=mday=d;}Date(int y=2000){year=y;month=10;day=1;}Date(Date d){year=d.year;month=d.month;day=d.day;}void print( ){cout<<year<<"."<<month<<"."<<day<<endl;}private:int year,month,day;};Date fun(Date d){Date temp;temp=d;return temp;}int main( ){Date datel(2000,1,1),date2(0,0,0);Date date3(datel);date2=fun(date3);return 0;}程序执行时,Date类的拷贝构造函数被调用的次数是A.2B.3C.4D.5

考题 以下程序的运行结果是#include "stdio.h"main(){struct date{int year,month,day;}today;printf("%d\n",sizeof(struct date));}A.6B.8C.10D.12

考题 以下程序运行后的输出结果是【】include main ( ) {char a[] ="123456789", *p;int i =0; 以下程序运行后的输出结果是【 】include <stdio.h>main ( ){ char a[] ="123456789", *p;int i =0;p=a;while( * p){ if(i%2 ==0) *p='*';p++;i++;}puts(a);}

考题 在下面程序的画线处填上适当的内容,使程序执行后的输出结果为1/2005。 include usin 在下面程序的画线处填上适当的内容,使程序执行后的输出结果为1/2005。include <iostream>using namespace std;class Date{public:Date(int m=1,int y=0):month(m),year(y){}void Print( ){cout<<month<<"/"<<year<<endl;}(9) operator+(const Datedl,const Date d2);private:int month,year;};(10) operator+(const Date dl,const Date d2){int year,month;year=d1.year+d2.year;month=d1.month+d2.month;year+=(month-1)/12;month=(month-1)%12+1;return Date(month,year);}void main( ){Date dl(3,2004),d2,d3(10);d2=d3+dl;d2.Print( );}

考题 在下面程序的横线处填上适当的内容,使程序执行后的输出结果果为1/2005。 include using 在下面程序的横线处填上适当的内容,使程序执行后的输出结果果为1/2005。include<iostmam>using namespace std;class Date{public:Date(int m=1,int y=0):month(m),year(y){}void Print(){cout<<month<<"/"<<year<<endl;}operator+(const Dated1.const Date d2);private:int month,year;};operator+(const Dated1,const Date d2){int year,month;year=d1.year+d2.year;month=d1.month+d2.month;year+=(month-1)/12;month=(month-1)%12+1;return Date(month,year);}void main(){Date d1(3,2004),d2,d3(10);d2=d3+d1;d2.Print();}

考题 有以下程序: class Date { public: Date(int y,int m,int D) ; { year =y; month=m; day=d; } Date(int y=2000) { year=y; month=10; day=1; } Date(Date D) { year=d.year; month=d.month; day=d.day; } void print () { cout<<year<<"."<<month<<"."<<day<<end1; } private: int year,month,day; }; Date fun(Date D) { Date temp; temp=d; return temp; } int main() { Date date1(2000,1,1),date2(0,0,0); Date date3(date1); date2=fun(date3); return 0; } 程序执行时,Date类的拷贝构造函数被调用的次数是A.2B.3C.4D.5

考题 下面结构体的定义语句中,不正确的是______。A.structdate { int month; int day; int year; } Struct date datel;B.stmctdate { intmonth; int day; int year; } datel;C.struct { int month; int day; int year; } date 1;D.#define DATE stmct date DATE { int month; int day; int year; }datel;

考题 有以下程序include using namespace std;static int days[]= { 31,28,31,30,31,30,31 有以下程序 #include <iostream> using namespace std; static int days[]= { 31,28,31,30,31,30,31,31,30,31,30,31 }; class date { private: int month, day, year; public: date( int m, int d, int y ) { month = m; day = d; year = y; } date() {} void disp() { cout<<year<<"-"<<month<<"-"<<day<<end1; } date operator+( int day ) { date dt = *this; day+= dt.day; while ( day > days[dt.month - 1 ] ) { day -= days[ dt.month - 1 ]; if ( ++dt.month == 13 ) { dt.month = 1; dt.year++; } } dt.day = day; return dt; }; int main() { date d1( 6, 20, 2004 ), d2; d2: d1 + 20; d2.disp(); return 0; } 执行后的输出结果是A.2004-7-10B.2004-6-20C.2004-7-20D.程序编译时出错

考题 有以下程序 include main() { int a=1, b=2, c=3, x; x=(a^b)c; pri 有以下程序 #include <stdio.h> main() { int a=1, b=2, c=3, x; x=(a^b)c; printf("%d\n",x); } 程序的运行结果是A.0B.1C.2D.3

考题 有以下程序include usingnamespacestd;static int days []={31,28.31,30,31,30,31,31 有以下程序 #include <iostream> using namespace std; static int days []={31,28.31,30,31,30,31,31,30,31,30,31}; class date { private: int month, day, year: public: date (int m, int d, int y { month = m; day = d; year = y; } date{} {} void disp {) { cout <<year<<" - "<<month<< "- "<<day<<end1; } date operator+(int day) { date dt = *this: day += dt.day; while { day > days[ dt.month - 1 ] ) { day -= tays[ dt.month - 1 ]; if ( ++dt.month == 13 { dt.month = 1; dt.yeare++; } } dr. day = day; return dt; } }; int main() { date d1( 6, 20, 2004 ), d2; d2.= d1 + 20; d2.disp (); return 0; } 执行后的输出结果是A.2004-7-10B.2004-6-20C.2004-7-20D.程序编译时出错

考题 有以下程序#include "stdio.h"main(){ struct date { int number; float fenzhi; char name; }stu; printf("%d\n",sizeof(stu));} 程序的运行结果是A.3 B.5C.7 D.8

考题 阅读以下说明和C++抖程序,将应填入(n)处的字句写在答题纸的对应栏内。【说明】下面程序的功能是计算并输出某年某月的天数。【C++程序】include<iostream>using namespace std;(1) Month{Jan,Feb,Mar,Art,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec};class Date{public:Date(int year,Month m_month){(2) =year;if (m_month<Jan‖m_month>Dec) month=Jan;else month=m_month;};~Date(){};bool IsLeapYear(){return ((year%4==0 year%1001!=0)‖year%400==0);};int CaculateDays(){switch( (3) ){case Feb:{if( (4) )return29;e1Se return 28;}case Jan:case Mar:case May:case Jul:case AUg:case Oct:case Dec:retllrn 31;case Apr:case Jun:Case Sep:case Nov:roturu30;}};private:int year;Month month;};void main(){Date day(2000,Feb);tout<<day. (5) ();}

考题 以下程序运行后的输出结果是( )。 include main() { int x=20; printf("%d", 0 以下程序运行后的输出结果是( )。include<stdio.h>main(){ int x=20;printf("%d", 0<x<20);printf("%d\n", 0<x x<20);}

考题 下面程序的运行结果是( )。include main(){int a=25; fun(A); }fun(int *x){ print 下面程序的运行结果是( )。include<stdio.h>main(){int a=25;fun(A);}fun(int *x){ printf("%d\n",++*x);}

考题 有以下程序#include "stdio.h"main(){ struct date {int year,month,day;}today; printf("%d\n",sizeof(struct date));}程序的运行结果是A.6 B.8C.12 D.10

考题 有以下程序:includeusingnamespacestd;staticintdays[]={31,28,31,30,31,30,31,31,30 有以下程序: #include <iostream> using namespace std; static int days[]={ 31,28,31,30,31,30,31,31,30,31,30,31 }; class date { private: int month,day,year; public: date( int m,int d,int y ) { month = m; day = d; year = y; } date() {} void disp() { cout<<year<<"-"<<month<<"-"<<day<<end1; } date operator+( iht day ) { date dt = * this; day += dt.day; while ( day > days[ dt.month - 1 ] ) { day -= days[ dt.month - 1 ]; if ( ++dt.month == 13 ) { dt.month = 1; dt.year++; } } dt.day = day; return dt; } }; int main() { date dl( 6, 20, 2004 ), d2; d2 = dt + 20; d2.disp(); return 0; } 执行后的输出结果是( )。A.2004-7-10B.2004-6-20C.2004-7-20D.程序编译时出错

考题 下列程序的运行结果为( )。 #includestdio.h main { struct date {int year,month,day; }today; printf("%d\n",sizeof(struct date)); }A.8B.6C.10D.12

考题 下列程序的运行结果为()。include main(){stmct date {int year,month,day; }today; pr 下列程序的运行结果为( )。 #include <stdio.h> main() { stmct date {int year,month,day; }today; printf("%d\n",sizeof(struct date)); }A.8B.6C.10D.12

考题 下列程序的运行结果为( )。#includestdio.hmain{ struct date{int year,month,day;}today;printf(%d\n,sizeof(struct date));}A.8B.6C.10D.12

考题 有以下程序includeusing namespace std;static int days []={31,28,31,30,31,30,3l,3 有以下程序 #include<iostream> using namespace std; static int days []={31,28,31,30,31,30,3l,31,30,31,30,31}; class date { private: int month,day,year; public: date(int m,int d,int y) { month=m; day=d; year=y; } date() {} void disp() { cout<<year<<"-"<<month<<"-"<<day<<end1; } date operator+(int day) { date dt=*this; day+=dt.day; while(day>days[dt.month-1]) { day-=days[dt.month-1]; if(++dt.month==13) { dt.month=1; dt.year++; } } dt.day=day; retrn dt; } }; int main() { date d1(6,20,2004),d2; d2=d1+20; d2.disp(); return 0; } 执行后的输出结果是A.2004-7-10B.2004-6-20C.2004-7-20D.程序编译时出错

考题 阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。【说明】下面程序的功能是计算并输出某年某月的天数,函数IsLeap Year()能够判断是否是闰年。【C++程序】include < iostream >using namespace std;(1) Month {Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec };class Date {public:Date( int year, Month m_ month) {this→year = year;if( (2) ) month: Jan;else month = m_ month;};~Date(){};bool IsLeap Year( ) {return ((year%4= =0 year% 100 ! =0)|| year%400= =0);};int CaculateDays( ) {switch(m_month ) {case (3) ;{if (4) return 29;else return 28;}case Jan: case Mar: case May: case Jul: case Aug: case Oct: case Dec: return 31;case Apr: case Jun: case Sop: case Nov: return 30;}}private:int year;Month month;};void main( ) {Date day(2000,Feb);cout < <day. (5) ( );}

考题 在下向程序和横线处填上适当的内容,使程序执行后的输出结果为1/2005。 include using 在下向程序和横线处填上适当的内容,使程序执行后的输出结果为1/2005。include <iostream>using namespace std;class Date{public:Date(int m=1,int y=0):month(m),year(y){}void Print() {cout<<month<<"/"<<year<<end 1; }【 】 operator+(eonst Date d1, const Date d2);private:int month,year;};【 】 operator+(const Date d1, const Date d2){int year,month;year=d1.year+d2.year;month=d1. month+d2.month;year+=(month-1 )/12;month=(month-1 )% 12+1;return Date(month,year);}void main()Date d1 (3,2004),d2,d3(10);d2=d3+d1;d2,Print();}

考题 下列程序的运行结果为()。includemain(){struct date {int year,month,day; }today; pr 下列程序的运行结果为( )。 #include<stdio.h> main() { struct date {int year,month,day; }today; printf("%d\n",sizeof(struct date)); }A.8B.6C.10D.12

考题 有以下程序: Class Date {public: Date(int y,int m,int d); {year=y; month=m; day=d;} Date(int y=2000) {year=y; month=10; day=1;) Date(Date D) {year=d.year; month=d.month; day=d.day;} void print() {cout<<year<<“.”<<moA.2B.3C.4D.5