DEV C++自定义函数顺序与printf用法
2024-09-08 07:38:10
#include <stdio.h>
//int gys(int a,int b);//函数声明
int main()
{
int a = 520;
int c1=98;
int c2=56;
char b = 'F';
float c = 3.14;
double d = 3.141592653;
printf("%d,%d\n",a,b);
printf("%10d,%d\n",a,b);
printf("%10d,%5d\n",a,b);
printf("%-10d,%5d\n",a,b);
printf("%-10d,%-5d\n",a,b);
printf("%-10.2d,%-5.2d\n",a,b);
printf("%-10.2f,%-5.2f\n",a,b);
printf("鱼C工作室创办于2010年的%d\n", a);
printf("I love %cishC.com!\n", b);
printf("I love %dishC.com!\n", b);
printf("圆周率是:%.2f\n", c);
printf("圆周率是:%6.2f\n", c);
printf("精确到小数点后9位的圆周率是:%11.9f\n", d);
printf("精确到小数点后9位的圆周率是:%15.9f\n", d);
printf("%d,%d的最大公约数为%d",c1,c2,gys(c1,c2));
return 0;
}
//
int gys(int a,int b)//函数定义;此函数的功能为求最大公约数
{
if (b==0)
return a;
return gys(b,a%b);
}
最新文章
- placeholder不兼容 IE10 以下版本的解决方法
- 微信";附近的人";新增商家公众号入驻功能
- xcode8升级后问题总汇
- 详解SpringMVC请求的时候是如何找到正确的Controller[附带源码分析]
- 回忆读windows 核心编程
- UML建模
- Fegla and the Bed Bugs 二分
- shell/bash 交集、并集、差集
- Linux kill -9 和 kill -15 的区别
- 【CSS】Beginner1:Applying CSS
- 性能测试 - some
- 在Docker中运行torch版的neural style
- 段(SEGMENT)
- kinect for windows - 手势识别之一,kinect手势识别框架
- 如何收集 EBS 各种相关业务的表的数据
- Hbulider里面template模板自用
- Java 封装 HDFS API 操作
- tensorflow让程序学习到函数y = ax + b中a和b的值
- 009 pandas的Series
- SDN中的Heavy-Hitter测量文献阅读
热门文章
- 编译ONNX模型Compile ONNX Models
- TensorRT 基于Yolov3的开发
- Lombok——一款Java构建工具,“懒人”必备!!(idea版)
- 【NX二次开发】Block UI 树列表
- 【NX二次开发】创建扫描特征
- 【Azure 机器人】微软Azure Bot 编辑器系列(4) : 使用语言生成功能[LG: Language Generation] (The Bot Framework Composer tutorials)
- UNREFERENCED_PARAMETER的用处
- csps前小结
- 前台使用Vue
- windows 上 OpenSSH 服务 启用秘钥登录(微软真心逆天)