首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
#include<stdio.h>
int main()
{
int a;
int b;
int max;
scanf("%d%d",&a,&b);
max=(a>b)?a:b;
printf("max=%d\n",max);
return 0;


......................
阅读全部 | 影子—— 贴于 2019年1月16日 17:44     hide bbsi
#include<math.h>
#include<stdio.h>
main()
{
int a=1,b=1,c=1;
float i=0.0,d=0.0001;
while(fabs(1./a)>=fabs(d))
{
i=i+1/a;
if(b%2!=0)
c=-1;
else c=1;
......................
阅读全部 | zzz 贴于 2019年1月12日 22:08     hide bbsi
/*本程序统计输入的字符串取最长的一组并统计数字、字母、符号等的个数,版本v2019.01.10*/
/*本程序在windows系统,通过c-free 3.5.2程序编译*/
#include <stdio.h>
#define MAXLINE 1000

int get_line(char line[],int maxline);
void copy_line(char to[],char from[]);

int main()
{
    int len;
    int max;
......................
阅读全部 | 陈xx 贴于 2019年1月10日 18:38     hide bbsi
#include<stdio.h>
int MA[4];     /*空闲块数组*/
int A[9][4]={{3,1,2,3},{3,4,5,6},{0,0,0,0},{0,0,0,0},{3,0,7,8},
             {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}};  /*磁盘空间专用块*/
int mark[9];       /*存放已分配的块*/
int No=0;              /*已分配的块数*/
void display1()//无参数无返回值的显示类函数,重要的是函数体 
{   int i,j,temp,count;
    No=0;
    if(MA[1]!=0)
       {   i=MA[0];
           printf("\n第1组:");
......................
阅读全部 | qiscoys 贴于 2019年1月3日 16:11     hide bbsi
#pragma once
#define NUM1 128
#define NUM2 50
#define Col 80
#define Line 25
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
using namespace std;
 
class Book {
......................
阅读全部 | a18064169453 贴于 2019年1月3日 15:22     hide bbsi
#include<stdio.h>
int div(int x,int y);
int mul(int x,int y);
main(){
int a,b,n;
scanf("%d,%d",&a,&b);
n=mul(a,b);
printf("%d,%d最小公倍数的是:%d\n",a,b,n);

}


......................
阅读全部 | 陈无 贴于 2018年12月20日 22:00     hide bbsi
#include"stdio.h"
float function(int iScore[],float ave);
main()
{
int i,SIZE;
int iScore[SIZE];
float ave;
printf("请输入成绩的个数:\n");
    scanf("%d",&SIZE);
    printf("请输入成绩:\n");
     for(i=0;i<SIZE;i++)
  {
......................
阅读全部 | 编程小白1号 贴于 2018年12月16日 17:04     hide bbsi
/**
 * This file has no copyright assigned and is placed in the Public Domain.
 * This file is part of the mingw-w64 runtime package.
 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 */
#ifndef _INC_STRING
#define _INC_STRING

#include <crtdefs.h>

#ifdef __cplusplus
extern "C" {
......................
阅读全部 | cstdio 贴于 2018年12月16日 15:43     hide bbsi
#include<stdio.h>
int main()
{
int a;
int b;
int max;
scanf("a=%d\n,b=%d\n",&a,&b);
max=(a>b)? a:b;
printf("max=%d\n",max);
return 0;


......................
阅读全部 | 加油胡椒粉 贴于 2018年12月13日 09:35     hide bbsi
疏散规则:
(1)    将教室离散成为大小相等的网格,每个同学在单位时间内只能移动一个网格或者保持不动,并且移动方向只能时上、下、左、右(如图2);
(2)    如果某个同学选择的移动目标网格被其他同学占用,那么该同学选择等待;
(3)    如果多个同学同时竞争同一网格,随机选择其中一个同学占用该网格,其余同学保持不动;
(4)    同学不能移动到桌子占用的网格,并且只能通过出口处进行疏散;
(5)    当所有同学疏散完成后,算法结束。
阅读全部 | myf1926 贴于 2018年12月9日 18:05     hide bbsi
上一页 57 58 59 60 61 62 63 64 65 66 下一页