博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
水仙花数(详细2
阅读量:4626 次
发布时间:2019-06-09

本文共 403 字,大约阅读时间需要 1 分钟。

 

 

#include <stdio.h>

int main( )
{
int a,b,c,s ;
s=0 ;
for(a=1; a<=9; a++)
for(b=0; b<=9; b++)
for(c=0; c<=9; c++)
if(a+b+c==10 || a+b+c==20 ) s++ ;

printf("%d\n",s);

}

 

 

 

**************************

#include <stdio.h>
int main( )
{
int a,b,c,s ;
s=0 ;
for(a=1; a<=9; a++)
for(b=0; b<=9; b++)
for(c=0; c<=9; c++)
if( (a+b+c)%10==0 ) s++ ;

printf("%d\n",s);

}

转载于:https://www.cnblogs.com/2014acm/p/3908545.html

你可能感兴趣的文章
web学习记录-JS-12
查看>>
ubuntu安装软件包apt-get和dpkg方法
查看>>
像Hacker News一样排序博客园首页文章
查看>>
TFS数据服务器分析
查看>>
状态图(Statechart Diagram)
查看>>
find命令
查看>>
md5 对字符串进行加密的方法 简单好用
查看>>
sqlsever还原时,数据库重命名
查看>>
【第三组】场景+用例文档+功能说明书+技术说明书 2014.7.22
查看>>
PHP文件操作函数
查看>>
关于rem布局以及sprit雪碧图的移动端自适应
查看>>
报表、图表制作总结
查看>>
单例模式
查看>>
称球问题
查看>>
C# vs2017 winForm 用NOPI(第三方库)导入Excel文件到datagridview
查看>>
html5 web storage
查看>>
mvc与webForm区别
查看>>
2.Rest Server提供数据库的Json字符串
查看>>
ajax多级菜单栏
查看>>
XAML with custom namespaces and prefixes (WPF/Silverlight)
查看>>