Skip to content

Instantly share code, notes, and snippets.

@p3nj
Last active August 29, 2015 14:25
Show Gist options
  • Save p3nj/01ff7f08973a160aa488 to your computer and use it in GitHub Desktop.
Save p3nj/01ff7f08973a160aa488 to your computer and use it in GitHub Desktop.
#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