/*
NAME: TEST
AUTHOR: DDDDD
DATE : 2014-11-24
MODIFY: 2014-11-24 10:23
*/
#include
int main()
{
int a,b,c;
a = 25; //十进制
b = 025; //以0开头的是八进制
c = 0x25; //以0x开头的是十六进制
printf("a = %d, b =%d, c = %d\n",a,b,c);
return 0;
}
20:12:37
super丶小波 2014/11/24 20:12:37
/* ************************************************************
NAME : LISHUBO
AUTHOR : SDF
DATE : 2014-11-19
注释 : 这是c程序,他的功能是输入一些数字,达到运算的效果。
*************************************************************** */
#include
float g=0,c=0;
void main()
{
void one();
void two();
void three();
void four();
void five();
int t;
do
{
one();
printf("menu:\n");
printf("1.yunsuan\n2.Save \n3.Delete\n4.Exit\n");
scanf("%d",&t);
if("t==1||t==2||t==3||") one();
else two();
switch(t)
{
case 1:printf("1.yunsuan:");three();break;
case 2:printf("2.Save:");four();break;
case 3:printf("3.Delete:");five();break;
default:break;
}
}
while(t<4||t>4);
}
void one()
{
printf("look:\n");
}
void two()
{
printf("Error!!!\n");
}
void three()
{
float a,b,c;
int s;
printf("Menu:\n");
printf("1.add(+)\n2.sub(-)\n3.mul(*)\n4.rem(/)\n");
scanf("%d",&s);
if(s==5) two();
else
printf("input two number:\n");
if(s==1)
{
scanf("%f %f",&a,&b);
c=a+b;
printf("Sum is %f\n",c);
g=c+g;
}
else if (s==2)
{
scanf("%f %f",&a,&b);
c=a-b;
printf("Differ is %f\n",c);
g=c+g;
}
else if(s==3)
{
scanf("%f %f",&a,&b);
c=a*b;
printf("Amass is %f\n",c);
g=c+g;
}
else if(s==4)
{
scanf("%f %f",&a,&b);
if(b==0) two();
else
c=a/b;
printf("Trade is %f\n",c);
g=c+g;
}
}
void four()
{
g=g+c;
printf("%f\n",g);
}
void five()
{
g=c-c;
printf("%f\n",g);
}
阅读(1411) | 评论(0) | 转发(0) |