#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);
}
原文链接: https://www.cnblogs.com/xkdn/p/14438101.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/208377
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!