一个C++作业求大神~!!!

题号:11 题型:单选题(请在以下几个选项中选择唯一正确答案) 本题分数:3.57

内容:
设有如下定义int
x=10,y=3,z;则语句printf("%d\n",z=(x%y,x/y));的输出结果是( )
选项:
a、3
b、0
c、4
d、1

题号:12 题型:单选题(请在以下几个选项中选择唯一正确答案) 本题分数:3.57
内容:
设有整型变量m值为8,下列赋值语句中,正确的是(
)
选项:
a、m=m++
b、++m=6
c、m+1=8
d、m+1+=8

题号:13 题型:单选题(请在以下几个选项中选择唯一正确答案) 本题分数:3.57
内容:
有输入语句:scanf("a=%d,b=%d,c=%d",&a,&b,&c);为使变量a的值为1,b为3,c为2,从键盘输入数据的正确形式应当是(
)(u代表空格)
选项:
a、132<CR>
b、1,3,2<CR>
c、a=1ub=3uc=2<CR>
d、a=1,b=3,c=2<CR>

题号:14 题型:单选题(请在以下几个选项中选择唯一正确答案) 本题分数:3.57
内容:
printf("\n*s1=%15s*","chinabeijing");printf("\n*s2=%-5s*","chi");以上程序的输出结果是(
)(u代表空格)
选项:
a、*s1=chinabeijinguuu* (换行)*s2=**chi*
b、*s1=chinabeijinguuu*(换行)*s2=chiuu*
c、*s1=uuchinabeijing*
(换行)*s2=uuchi*
d、* s1=uuuchinabeijing*(换行)*s2=chiuu*

题号:15 题型:单选题(请在以下几个选项中选择唯一正确答案) 本题分数:3.57
内容:
根据题目中已给出的数据输入和输出形式,main(){int
x;float y;printf("enter x,y:");输入语句;输出语句}输入形式:enter x,y:2 3.4输出形式:x+y=5.40,
程序中输入输出语句的正确内容是( )
选项:
a、scanf("%d,%f",&x,&y),printf("\nx+y=%4.2f",x+y)
b、scanf("%d%f",&x,&y),printf("\nx+y=%4.2f",x+y)
c、scanf("%d%f",&x,&y),printf("\nx+y=%6.1f",x+y)
d、scanf("%d%3.1f",&x,&y),printf("\nx+y=%4.2f",x+y)

题号:16 题型:单选题(请在以下几个选项中选择唯一正确答案) 本题分数:3.57
内容:
执行语句scanf("%d,%d",&m,&n);使m和n的值分别为1和2,正确输入是(
)
选项:
a、1
b、1 2
c、1,2
d、12,2

题号:17 题型:单选题(请在以下几个选项中选择唯一正确答案) 本题分数:3.57
内容:
设整型变量a和b的值分别为8和9。printf("%d,%d",(a++,++b),b--);的输出是(
)
选项:
a、8,8
b、8,7
c、9,9
d、10,9

题号:18 题型:单选题(请在以下几个选项中选择唯一正确答案) 本题分数:3.57
内容:
以下程序main(){int
x=10,y=10;printf("%d %d\n",x--,--y);}的输出结果是( )
选项:
a、10
10
b、9 9
c、9 10
d、10 9

第1个回答  2014-08-16
/*------------------------习题1--------------------------*///MyDate.h#pragma onceclass MyDate{public: MyDate(void); ~MyDate(void); MyDate(int year,int month,int day); void showDate();private: int year; int month; int day;};//MyDate.cpp#include "StdAfx.h"#include "MyDate.h"MyDate::MyDate(void){ this->year = 1991; this->month = 1; this->day = 25;}MyDate::~MyDate(void){}MyDate::MyDate(int year,int month,int day){ this->year = year; this->month = month; this->day = day;}void MyDate::showDate(){ cout<<"date is :"<<this->year<<"-"<<this->month<<"-"<<this->day<<endl;}//测试代码#include "stdafx.h"#include "MyDate.h"int _tmain(int argc, _TCHAR* argv[]){ // 调用默认构造函数 MyDate* date = new MyDate(); (*date).showDate(); // 调用重载构造函数 MyDate* date1 = new MyDate(2014,4,15); (*date1).showDate(); system("pause"); return 0;}//运行结构date is :1991-1-25date is :2014-4-15/*------------------------习题2--------------------------*///Employee.h#pragma onceclass Employee{public: Employee(char* name,char* address,int postcod); ~Employee(void); void modName(char* newName); void modAdd(char* newAdd); void modPostCod(int newPostCod); void showAll();private: char* name; char* address; int postcod;}; //Employee.cpp#include "StdAfx.h"#include "Employee.h"{this->name = name;this->address = address;this->postcod = postCod;}Employee::~Employee(void){}void Employee::modName(char* newName){name = newName;}void Employee::modAdd(char* newAdd){address = newAdd;}void Employee::modPostCod(int newPostCod){this->postcod = newPostCod;}void Employee::showAll(){cout<<"name="<<this->name<<endl<<"address="<<this->address<<endl<<"postCod="<<this->postcod<<endl;}//测试程序#include "stdafx.h"#include "MyDate.h"#include "Employee.h"int _tmain(int argc, _TCHAR* argv[]){ Employee* em = new Employee("xiaoyu","shanghai",20000); em->modName("xiaowang"); em->showAll(); system("pause"); return 0;}// 运行结果name=xiaowangaddress=shanghaipostCod=20000Press any key to continue . . ./*------------------------习题3--------------------------*/// Cylinder.h#pragma once#define PI 3.14class Cylinder{public: Cylinder(double r,double h); ~Cylinder(void); double vol();private: double r; double h; double volume;};// Cylinder.cpp#include "StdAfx.h"#include "Cylinder.h"Cylinder::Cylinder(double r,double h){ this->r = r; this->h = h; this->volume = this->r * this->r * PI * this->h;}Cylinder::~Cylinder(void){}double Cylinder::vol(){ return this->volume;}// 测试代码#include "stdafx.h"#include "MyDate.h"#include "Employee.h"#include "Cylinder.h"int _tmain(int argc, _TCHAR* argv[]){ Cylinder* cyl = new Cylinder(12,6); cout<<"vol is:"<<(*cyl).vol()<<endl; system("pause"); return 0;}// 运行结果vol is:2712.96Press any key to continue . . .追问

大神= =求 题号+答案~

第2个回答  2014-08-16
12a 14d 18d追问

谢大神了= =你的对的!!我输入了一下

第3个回答  2014-08-16
12, D 18,C追问

大神来个全部的吧~~~

追答

都忘了,,那个(a,b),号是什么运算符号?。
这种题你可以打开软件运行一下不就知道答案了

追问

T T都不会~~

追答

照着题往软件上打啊,这都不会。。

追问

恩 弄好了= =大神你都错了~

追答

.12是B吧,18应该是D。。好久没碰过这东西了,,

本回答被提问者采纳
相似回答