www.5129.net > 求程序代码

求程序代码

#include main() { int a,b,c; printf("请输入两个整数:"); scanf("%d%d",&a,&b); c=a+b; printf("这两个数的和是:\n%d+%d=%d",a,b,c); } #include void main() { int a,b,sum; a=123;b=456; sum=a+b; printf("sum is %d\n",sum); } 完成

#define PI 3.1415926 #include #include using namespace std; int days_of_month_1[]={31,28,31,30,31,30,31,31,30,31,30,31}; int days_of_month_2[]={31,29,31,30,31,30,31,31,30,31,30,31}; long double h=-0.833; //定义全局变量 void inp...

import java.awt.BorderLayout;import java.awt.Dimension;import java.awt.GridLayout;import java.awt.Toolkit;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFra...

public class TestStar { public static void main(String[] args) { String star = "*"; for (int i = 0; i < 5; i++) { if (i == 0) { System.out.print(" " + star); System.out.println(); } if (i == 1) { for (int z = 0; z < 4; z++) { S...

程序源码及运行结果如下所示(系统会自动去掉句首空格,排版较乱请见谅): #includeint main(){int max,min;int sum=0;printf("请输入一个整数:");scanf("%d",&max);printf("请再输入一个整数:");scanf("%d",&min);if(min>max){int temp;temp...

写好了,你看看吧,有要求再提 #include #include int main(){ char input[50]; printf("请问 1+1="); for(;;){ gets(input); if(strcmp(input,"2")==0) {puts("正确");break;} printf("重新输入 1+1="); } getch(); }

用递归法求N的阶乘 程序调用自身称为递归( recursion).它通常把一个大型复杂的问题层层转化为一个与原问题相似的规模较小的问题来求解. 递归的能力在于用有限的语句来定义对象的无限集合。 一般来说,递归需要有边界条件、递归前进段和递归返...

这几题都简单:新手就这样做 1: #include void main() {printf("%d,%o,%x",0,0,0); printf("%d,%o,%x",9,9,9); printf("%d,%o,%x",A,A,A); printf("%d,%o,%x",Z,Z,Z); } 2: #include void main() {int a,b,t; scanf("%d,%d",&a,&b); t=a;a=b;b...

#includeint main(void){int n,i,j;printf("please input n: ");scanf("%d",&n);for(i = 0; i < n; i++){for(j = 0; j < n; j++){if(j == n-i-1 || j == i)putchar('@');elseputchar(' ');}putchar('\n');}return 0;}

我有个类似的 你稍微改一下就行 ---------------------------------------- #include int main(void) { int a,b,c,d,e,f,g; /*a是商品价格,b是付款价格,c是50元找零张数,d是10元张数,e是5元,f是1元,g是找零金额*/ printf("请输入商品价格:"...

网站地图

All rights reserved Powered by www.5129.net

copyright ©right 2010-2021。
www.5129.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com