1/28 if
来源:互联网 发布:乌鲁木齐网站排名seo 编辑:程序博客网 时间:2024/06/10 22:52
#include <stdio.h>// judge the number whether can be divisible by 3 or 5int main(){ printf("judge the number a ,whether can be divisible by 3 or 5\n"); int a; scanf("%d",&a); int b,c; b=a%3; c=a%5; if ((b==0)||(c==0)) { printf("%d\n",a); } return 0;}
#include <stdio.h>//if a+b<100 print a+b//if a+b>100 print a+b>=10^2int num_100above(int a){ int b; b=a/10; return b;}int main(){ printf("please insert a and b\n"); int a,b; scanf("%d %d",&a,&b); if(a+b<=100) { printf("%d",a+b); } else { printf("%d",num_100above(a+b)); } return 0;}
#include <stdio.h>//calculate y=x-1(x>=1)//y=-x+1(x<1)int main(){ printf("insert x\n"); int x,y; scanf("%d",&x); if(x>=1) { y=x-1; } else { y=-x+1; } printf("%d\n",y); return 0;}
#include <stdio.h>#include <math.h>double yx(double x){ double y; if(x>=0) { y=(sin(x)+cos(x))/2.0; } else { y=(sin(x)-cos(x))/2.0; } return y;}int main(){ double y,x; printf("insert x\n"); scanf("%lf",&x); y=yx(x); printf("%f",y); return 0;}
#include <stdio.h>//calculate salary//h=40//if h=40 salary=rate*hour//if h>=40 addition=rate*1.5*addhoursint main(){ int rate,hours,addhours; double salary; printf("insert rate and hours\n"); scanf("%d %d",&rate,&hours); if(hours<=40) { salary=rate*hours; } else{ addhours=hours-40; salary=40*rate; salary=salary+addhours*1.5*rate;}printf("salary is %f\n",salary); return 0;}
#include <stdio.h>int main(){ printf("please insert hours and minutes\npay attention to sequence\n"); int hours,minutes; scanf("%d %d",&hours,&minutes); if(hours<=9) { printf("0"); } printf("%d:",hours); if(minutes<=9) { printf("0"); } printf("%d\n",minutes); return 0;}
0 0
- 1/28 if
- if(-1)
- “#if 0/#if 1 ... #endif”
- if 1 endif if 0
- C中#if 0 和#if 1
- C中#if 0 和#if 1
- #if 0 /#if 1作用与用法
- C中#if 0 和#if 1
- C中#if 0 和#if 1
- C中#if 0 和#if 1
- “#if 0/#if 1 ... #endif”的作用
- #if 0/#if 1 ... #endif”的作用
- “#if 0/#if 1 ... #endif”的作用
- C中#if 0 和#if 1
- C中#if 0 和#if 1
- “#if 0/#if 1 ... #endif”的作用
- C中#if 0 和#if 1
- “#if 0/#if 1 ... #endif”的作用
- hadoop 2.6.3 BlockPlacementPolicy分析
- python中if __name__ == '__main__': 的解析
- Android Audio System 之二:AudioFlinger
- Random.org -- 真正的随机数生成器
- UITbbar图片变形,或者不是图片原始状态
- 1/28 if
- android抓取各种log的方法
- 返回上一页,返回到最后一页的时候回调
- 23种设计模式 - java 实现
- [算法学习]给定一个整型数组,找出两个整数为指定整数的和(2)
- [计算机网络]TCP与UDP
- The connection to adb is down, and a severe error has occured
- java写文本文件三种方式效率比较
- ajax 新闻实例和数组