zoukankan      html  css  js  c++  java
  • 结对编程项目四则运算

    小组成员:李铖  130201209   李静远  130201210

    源代码

    #include "stdio.h"void main(){int x,y,result;float temp;char oprand,flag='Y';while(flag=='Y'||flag=='y'){do{printf("请输入四则运算式子 ");scanf("%d%c%d",&x,&oprand,&y);if(oprand!='+'&&oprand!='-'&&oprand!='*'&&oprand!='/')printf("Input error ");}while(oprand!='+'&&oprand!='-'&&oprand!='*'&&oprand!='/');switch(oprand){case '+':result=x+y;printf("result=%d ",result);break;case '-':result=x-y;printf("result=%d ",result);break;case '*':result=x*y;printf("result=%d ",result);break;case '/':if(y==0)printf("Divisor can not be 0 ");else {temp=(float)x;printf("result=%f ",temp/y);}break;}getchar();printf("结束运算Y/y or N/n ");scanf("%c",&flag);}}

    总结:

    这次作业完成后,可以实现基本的加减乘除,支持负数,分数,有括号。最多可以出现三个运算符。在合作的过程中,李铖主要负责编写代码,我主要负责查找和询问。李铖的优点是对作业比较上心,可以及时向周围的同学询问,态度积极。缺点是知识掌握的不好。我的优点是会一些基础的代码,逻辑思维较为缜密,态度积极。缺点是知识掌握的不牢固。在合作的过程中,可以结合两个人的优缺点来完成作业,起到互补的作用。但是有些时候会意见不同。

  • 相关阅读:
    centos yum安装与配置vsFTPd FTP服务器(转)
    CentOS 6.9安装配置nmon
    Linux 中将用户添加到组的指令
    linux 设置用户组共享文件
    linux时间同步ntpdate
    java获取端口号,不用request
    centos6.5 yum安装redis
    Centos6 yum安装nginx
    Nginx 不支持WebSocket TCP
    django中的分页应用 django-pure-pagination
  • 原文地址:https://www.cnblogs.com/li457803908/p/5361794.html
Copyright © 2011-2022 走看看