有一分段函数如下:输入x的值求出y的值 #include<iostream.h>int GetPower(int x,int y);void main(){ int x(0),y(0); cout<<"请输入X的值:"; cin >>x; cout<<"请输入y的值:"; cin >>y
任意输出4个整型数,按其从小到大的顺序输出。#include<iostream.h>void main(){ int a,b,c,d,t; cout<<"请输入四个整数:"; cin>>a>>b>>c>>d; if(a<b) {t=a; 
求100之内的自然数中能被13整除的最大数。#include<iostream.h>void main(){ int i,max; for(i=100;i<=100;i--) if(i%13==0) { max=i; cout<<"
求100之内的自然数中的偶数之和。#include<iostream.h>void main(){ int i,j; j=0; for(i=0;i<=100;i=i+2) j=i+j; cout<<j<<endl;} 或#include&l
课后作业2-22#include<iostream>using namespace std;void main(){ int myAge=39; int yourAge=39; cout<<"Iam:"<<myAge<<"years old.\
课后习题2-18#include<iostream.h>void main(){ int i; cout<<"Enter the number:"; cin>>i; cout<<i;} 课后习题2-12#include<iostre
#include<iostream>using namespace std;int main(){ int i; int j; i=10; j=20;cout<<"i+j="<<i+j; return 0;} 结果为30
1、#include<iostream.h>void main(){ int a,b,result; cout<<"please input two number:\n"; cin>>a>>b; result=3*a-2*b+1;&n
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号