Compare commits
15 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
51979d2ee0 | 6 years ago |
|
|
74d4c26318 | 6 years ago |
|
|
383246d007 | 6 years ago |
|
|
31111cd344 | 6 years ago |
|
|
9c2d013833 | 6 years ago |
|
|
ad9a4e0269 | 6 years ago |
|
|
9d66744216 | 6 years ago |
|
|
3b7ba6f8e3 | 6 years ago |
|
|
646d3206f7 | 6 years ago |
|
|
8caeef5c2b | 6 years ago |
|
|
88fb31b0e8 | 6 years ago |
|
|
92555551df | 6 years ago |
|
|
3155df874e | 6 years ago |
|
|
8e310673ab | 6 years ago |
|
|
edf60a998b | 6 years ago |
@ -0,0 +1,40 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cp.h>
|
||||
#include <minus.h>
|
||||
#include <pzd.h>
|
||||
#include <yx.h>
|
||||
int main(){
|
||||
int a,op1,op2;
|
||||
while(1){
|
||||
printf("----------------- Menu -------------------\n");
|
||||
printf("1.plus 2.minus 3.multiple 4.divide");
|
||||
printf("------------------------------------------\n");
|
||||
printf("Please choose your operator:");
|
||||
scanf("%d",&a);
|
||||
if(a==0) break;
|
||||
printf("Please input op1:");
|
||||
scanf("%d",&op1);
|
||||
printf("Please input op2:");
|
||||
scanf("%d",&op2);
|
||||
switch(a){
|
||||
case 1:
|
||||
add(op1,op2);//
|
||||
break;
|
||||
case 2:
|
||||
minus(op1,op2);//
|
||||
break;
|
||||
case 3:
|
||||
multi(op1,op2);//
|
||||
break;
|
||||
case 4:
|
||||
division(op1,op2);//
|
||||
break;
|
||||
default:
|
||||
printf("Please input correct number.\n");
|
||||
}
|
||||
}
|
||||
printf("Have a good time.");
|
||||
|
||||
return 1 ;
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
include<stdio.h>
|
||||
float minus(float a,float b);
|
||||
float minus(float a,float b)
|
||||
{
|
||||
a = a - b;
|
||||
printf("%d - %d",a,b);
|
||||
return a;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#ifndef GRAPHICS_H
|
||||
|
||||
#define GRAPHICS_H
|
||||
|
||||
float multi(float a,float b)
|
||||
{ float c;
|
||||
c=a*b;
|
||||
printf("c=%f”,c);
|
||||
return c;
|
||||
}
|
||||
Loading…
Reference in new issue