该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

用简单的printf 能编写出来,就是写的多了点.

#include

main()

{

int i,j,k,s;

printf("please enter year and week:");

scanf("%d",&i);

printf("\n");

scanf("%d",&j);

clrscr();

if((13%7+j-1)%7==5)

printf("%d January 13th is a black Friday!",i);

if(13%7+j-1+31==5)

printf("%d Febuary 13th is a black Friday!",i);

if(i%4==0)

{if((13%7+j-1+31+29)%7==5)

printf("%d March 13th is a black Friday!",i);

if((13%7+j-1+31+29+31)%7==5)

printf("%d Apirl 13th is a black Friday!",i);

if((13%7+j-1+31+29+31+30)%7==5)

printf("%d May 13th is a black Friday!",i);

if((13%7+j-1+31+29+31+30+31)%7==5)

printf("%d June 13th is a black Friday!",i);

if((13%7+j-1+31+29+31+30+31+30)%7==5)

printf("%d July 13th is a black Friday!",i);

if((13%7+j-1+31+29+31+30+31+30+31)%7==5)

printf("%d August 13th is a black Friday!",i);

if((13%7+j-1+31+29+31+30+31+30+31+31)%7==5)

printf("%d September 13th is a black Friday!",i);

if((13%7+j-1+31+29+31+30+31+30+31+31+30)%7==5)

printf("%d October 13th is a black Friday!",i);

if((13%7+j-1+31+29+31+30+31+30+31+31+30+31)%7==5)

printf("%d November 13th is a black Friday!",i);

if((13%7+j-1+31+29+31+30+31+30+31+31+30+31+30)%7==5)

printf("%d December 13th is a black Friday!",i);

}

if(i%4!=0)

{if((13%7+j-1+31+28)%7==5)

printf("%d March 13th is a black Friday!",i);

if((13%7+j-1+31+28+31)%7==5)

printf("%d Apirl 13th is a black Friday!",i);

if((13%7+j-1+31+28+31+30)%7==5)

printf("%d May 13th is a black Friday!",i);

if((13%7+j-1+31+28+31+30+31)%7==5)

printf("%d June 13th is a black Friday!",i);

if((13%7+j-1+31+28+31+30+31+30)%7==5)

printf("%d July 13th is a black Friday!",i);

if((13%7+j-1+31+28+31+30+31+30+31)%7==5)

printf("%d August 13th is a black Friday!",i);

if((13%7+j-1+31+28+31+30+31+30+31+31)%7==5)

printf("%d September 13th is a black Friday!",i);

if((13%7+j-1+31+28+31+30+31+30+31+31+30)%7==5)

printf("%d October 13th is a black Friday!",i);

if((13%7+j-1+31+28+31+30+31+30+31+31+30+31)%7==5)

printf("%d November 13th is a black Friday!",i);

if((13%7+j-1+31+28+31+30+31+30+31+31+30+31+30)%7==5)

printf("%d December 13th is a black Friday!",i);

}

}

c语言黑色星期五公式,求黑色星期五问题~相关推荐

  1. c语言pi的乘法,c语言 根据公式求出π的近似值。

    共回答了10个问题采纳率:80% #includedouble powi(double num, int multi) { double r = 1.0; int i; for (i = 0; i & ...

  2. 二级C语言-阶乘公式求值

    题目描述 编写程序,输入一个正整数n,求下列算式的值.要求定义和调用函数fact(k)计算k的阶乘,函数返回值的类型是double. 1+1/2+ .... +1/n! 输出保留无位小数 样例输入 5 ...

  3. 题目 1071: 二级C语言-阶乘公式求值

    题目描述 编写程序,输入一个正整数n,求下列算式的值.要求定义和调用函数fact(k)计算k的阶乘,函数返回值的类型是double. 1+1/2+ .... +1/n! 输出保留5位小数. #incl ...

  4. C语言试题十九之根据以下公式求p的值,结果由函数值带回。M与n为两个正整数,且要求m>n。 p=m!/n!(m-n)!

    1. 题目 编写函数function,功能是:根据以下公式求p的值,结果由函数值带回.M与n为两个正整数,且要求m>n. p=m!/n!(m-n)! 2 .温馨提示 C语言试题汇总里可用于计算机 ...

  5. c语言编程cosx近似值,编程利用公式求 cosx 的近似值(精度为10-6):

    输入精度e 和实数x,用下列公式求cos x 的近似值,精确到最后一项的绝对值小于e.c语言编程, #include#include//这个函数需要返回double类型,不然结果很快就溢出了doubl ...

  6. c语言编程序按下列公式计算e的值,编写程序,利用公式 ,求出e的近似值

    已知一个三角形中三条边的长度分别为a,b和c,编写程序利用公式求出三角形的面积,其中S=(a+b+c)/2.要求边长a. usingSystem;usingSystem.Collections.Gen ...

  7. c语言while根据近似公式求,c语言用π=1-1/3+1/5-1/7+.公式求π的近似值,直到最后一项的绝对值小于10^-6为止...

    题目: c语言用π=1-1/3+1/5-1/7+.公式求π的近似值,直到最后一项的绝对值小于10^-6为止 我编的程序 #include #include void main() {int i; fl ...

  8. 利用java格里高利公式求圆周率_C语言用下列公式求pi的近似值,直到最后一项的绝对值小于1e-4为止:...

    C语言 输入精度e 和实数x,用下列公式求cos x 的近似值,精确到最后一项的绝对值小于e。 #include  //头文件置顶#include double fact(int n){\ 用下面的近 ...

  9. 用C语言编写程序计算cos x 的近似值,输入精度 e 和 x,用下列公式求cos(x)的近似值...

    C语言 输入精度e 和实数x,用下列公式求cos x 的近似值,精确到最后一项的绝对值小于e。 #include  //头文件置顶#include double fact(int n){\ C语言编写 ...

最新文章

  1. java php net_网页快速入门(asp aps.net php java)
  2. mysql 两个数据库指定表同步_mysql从2个数据库中同步两个表
  3. 《Outlook时间整理术》一创建和使用自己的文件夹结构
  4. div超出不换行_文字超出显示点点点之ellipsis 设置
  5. java 如何放大动画图,Android仿微信图片放大动画
  6. python自动化输入不了中文_appium+python自动化61-中文输入乱码问题解决
  7. Redis——学习之路三(初识redis config配置)
  8. Linux中查看某个软件的安装路径
  9. php 可选表格,PHP_表格标记,  ■ 表格标记 TABLE - phpStudy
  10. 股票历史数据-股票前复权数据下载
  11. afterburner功耗限制调不了_为啥我的MSIAfterburner很多项都拖不了
  12. 读书|《赤裸裸的统计学》:统计数字很容易说谎
  13. Java 简易五子棋游戏的编写
  14. 服务器硬件规格常用查看命令——CPU相关命令
  15. 8.19华为笔试题目c++
  16. Java实现菱形图案
  17. 路由刷机(Breed)操作步骤
  18. 无线充电技术介绍系列之一(技术科普)【无线充电圈 技术分析】
  19. Linux diff命令详解
  20. 修改Anaconda默认的启动路径--亲测有效【附anaconda云盘链接】

热门文章

  1. android10 三星升级计划,Android 10.0(Q OS)系统升级计划Androi
  2. asp.net listview 字段太多 滚动条_高考英语阅读理解生僻单词太多怎么办?十大招数帮到你...
  3. 计算机科学与技术导论%1计算机网络,汕头大学计算机专业课程计划
  4. Docker实践(四)Dockerfile
  5. python具备的功能是_用了Python这么多年,揭秘Python不为人知的7大功能和特点!...
  6. OpenShift 4 - 通过Service的nodePort访问应用
  7. 解决重复出现问题的 (LINQ) 方法示例
  8. odoo10参考系列--视图二(表单视图)
  9. druid 多数据源_Spring Boot2 系列教程(二十二)整合 MyBatis 多数据源
  10. optional用法_还在重复写空指针检查代码?考虑使用 Optional 吧!