首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
/*
2022年3月29日14点15分
输入年份、月份、日期,输出这一天是该年份下的第几天。
*/

#include <iostream>
using namespace std;

int run(int year)
{
    if (year % 4 == 0 && year % 100 != 0) return true;
    else if (year % 400 == 0) return true;
......................
阅读全部 | StarLiver 贴于 2022年3月29日 14:16     hide bbsi
#include <stdio.h>
int gcd(int numa,int numb,int numc);
int i,j=1,k,d;
int a,b,c;
int main() {
    scanf("%d %d %d",&a,&b,&c);
    d=gcd(a,b,c);
    return 0;
}
//最大公约数
int gcd(int numa,int numb,int numc){
    int a=1;
......................
阅读全部 | anlagreenya 贴于 2022年3月29日 00:02     hide bbsi
#include <stdio.h> 
/*int main(){ 
    int a=10;
    int c;
    float b;
    c=a/3.0; 
    b=((double)(3/2)+0.5+(int)1.99*2);
    printf("%d\n",c);
    printf("%1f",b);
   // return 0; 
    
}*/
......................
阅读全部 | xutingting 贴于 2022年3月28日 23:22     hide bbsi
#include <stdio.h>
#include <iostream>
#include <math.h>

float f(float x, float y, float z) {
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}

float h(float x, float z) {
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f) {
......................
阅读全部 | czw2011 贴于 2022年3月26日 16:48     hide bbsi
#include <stdio.h>

unsigned foo( unsigned n );

int main( void )
{
    unsigned n;
    printf( "请输入台阶的级数:" );
    scanf( "%u", &n );
    printf( "走完%u级台阶有%u种走法\n", n, foo(n) );
}

......................
阅读全部 | 小神女 贴于 2022年3月20日 21:39     hide bbsi
#include <stdio.h>

unsigned foo( unsigned n );

int main( void )
{
    unsigned n;
    printf( "请输入台阶的级数:" );
    scanf( "%u", &n );
    printf( "走完%u级台阶有%u种走法\n", n, foo(n) );
}

......................
阅读全部 | 小神女 贴于 2022年3月20日 21:39     hide bbsi
#include <stdio.h>
int main()
{
float a, b, c, t;
scanf_s("%f,%f,%f", &a, &b, &c);
if (a > b)
{
t = a;
a = b;
b = t;
}
if (a > c) {
......................
阅读全部 | 快乐人儿 贴于 2022年3月16日 17:04     hide bbsi
/**
 * 【程序8】
 * 题目:输出9*9口诀。
 * 程序分析:分行与列考虑,共9行9列,i控制行,j控制列。
 */

#include<stdio.h>

int main() {
    int i,j,result;
    printf("\n");
    for (i=1;i<10;i++) {
......................
阅读全部 | yuanjie123 贴于 2022年3月10日 21:50     hide bbsi
color la
echo
color 2b
echo
color 3c
echo
color 4d
echo
color 5e
echo
color 6f
echo
......................
阅读全部 | ism 贴于 2022年3月9日 23:43     hide bbsi
#include <stdio.h>


int main()
{
    int a,b,c,d,e;
    float sum,aver;
    printf("Input 5 integers:");
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
    sum=a+b+c+d+e;
    ;aver=sum/5;
    printf("average=%f\n",aver);
......................
阅读全部 | 小羊就很棒 贴于 2022年3月7日 20:43     hide bbsi
上一页 22 23 24 25 26 27 28 29 30 31 下一页