| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 602 人关注过本帖
标题:这个课程设计哪个高手给个参考呢?
只看楼主 加入收藏
piepielove
该用户已被删除
收藏
已结贴  问题点数:20 回复次数:4 
这个课程设计哪个高手给个参考呢?
提示: 作者被禁止或删除 内容自动屏蔽
搜索更多相关主题的帖子: 课程 设计 
2010-05-04 20:45
flyue
Rank: 10Rank: 10Rank: 10
来 自:江南西道
等 级:贵宾
威 望:19
帖 子:3465
专家分:1563
注 册:2006-6-20
收藏
得分:5 
这类代码网上很多, 栈式计算器.

参见<编译原理>

天之道,损有余而补不足.人之道则不然,损不足以奉有余.孰能有余以奉天下,唯有道者.
2010-05-04 21:31
mjw1124
Rank: 2
来 自:湖北武汉
等 级:论坛游民
帖 子:48
专家分:48
注 册:2010-4-17
收藏
得分:5 
这个不难好吧。自己想,不会了,再找人
2010-05-04 22:37
南国利剑
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:29
帖 子:1165
专家分:3536
注 册:2010-4-12
收藏
得分:5 
程序代码:
#include "stdio.h"
#include<stdlib.h>

int  main()
{
    float a,b;
    char c;
    printf("欢迎使用计算器:\n");
    scanf("%f%c%f",&a,&c,&b);
    switch(c)
    {
    case '+':printf("%f+%f=%f\n",a,b,a+b);break;
    case '-':printf("%f-%f=%f\n",a,b,a-b);break;
    case '*':printf("%fX%f=%f\n",a,b,a*b);break;
    case '/':printf("%f/%f=%f\n",a,b,a/b);break;
    default:printf("输入错误!\n");
    }
    

    system("pause");
    return 1;   
}
写了一个,请楼主指教。至于计算函数的要根据函数的值,要根据具体是什么函数编写,情况类似。


[ 本帖最后由 南国利剑 于 2010-5-4 23:21 编辑 ]

南国利剑
2010-05-04 23:18
yjsdlg
Rank: 1
等 级:新手上路
帖 子:18
专家分:7
注 册:2010-3-6
收藏
得分:5 
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication6
{
     public partial class Form1 : Form
     {
         public Form1()
         {
             InitializeComponent();
         }

         private void button1_Click(object sender, EventArgs e)
         {
             double c;
             c = Convert.ToDouble(txtA.Text) + Convert.ToDouble(txtB.Text);
             txtC.Text = Convert.ToString(c);

         }

         private void button2_Click(object sender, EventArgs e)
         {
             double c;
             c = Convert.ToDouble(txtA.Text) - Convert.ToDouble(txtB.Text);
             txtC.Text = Convert.ToString(c);

         }

         private void button3_Click(object sender, EventArgs e)
         {
             double c;
             c = Convert.ToDouble(txtA.Text) * Convert.ToDouble(txtB.Text);
             txtC.Text = Convert.ToString(c);
         }

         private void button4_Click(object sender, EventArgs e)
         {
             double c;
             c = Convert.ToDouble(txtA.Text) / Convert.ToDouble(txtB.Text);
             txtC.Text = Convert.ToString(c);

         }

        
     }
}
2010-05-07 16:48
快速回复:这个课程设计哪个高手给个参考呢?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012874 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved