Last active
August 29, 2015 14:25
-
-
Save p3nj/01ff7f08973a160aa488 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
//简易计算器——加减乘除 | |
main() | |
{ | |
int a, b, choice, result; // | |
printf("选择算法:0.加法 1.减法 2.乘法 3.除法 4.结束\n输入您的选择:"); | |
switch(choice = getchar();) //大概是这样 有点忘了 | |
{ | |
case 1: | |
{ | |
printf("您选择的是加法\n请输入想算的数:\n"); | |
// ...... 加入算式代码 | |
} | |
case 2: | |
// 以下类推 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment