首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
data ends
code segment
start: mov ax,data
阅读全部 | 商殇 贴于 2018年6月16日 18:14     hide bbsi
成绩排序运行不了,总成绩怎么改成平均分~~请大家帮帮忙!!

#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
class student      
{
    friend class studentMessage;
    student      *next;
    char         name[30];
    char         num[30];
......................
阅读全部 | TongLee 贴于 2018年6月12日 12:37     hide bbsi
/*
 * locking.h
 * This file has no copyright assigned and is placed in the Public Domain.
 * This file is a part of the mingw-runtime package.
 * No warranty is given; refer to the file DISCLAIMER within the package.
 *
 * Constants for the mode parameter of the locking function.
 *
 */

#ifndef    _LOCKING_H_
#define    _LOCKING_H_
......................
阅读全部 | cstdio 贴于 2018年6月10日 18:37     hide bbsi
#include<stdio.h>
int max(int n, int str[100])
{
int i,mx;
mx = str[0];
for (i = 1; i < n; i++)
{
if ((str[i] >= mx)==1)
mx = str[i];
}
return max;
}
......................
阅读全部 | 天蓝蓝蓝 贴于 2018年5月12日 17:41     hide bbsi
#include<iostream>
#include<iomanip>
int a[15][15]={0};       //空格显示为0,玩家A下白棋显示为1,玩家B下黑棋显示为2 
using namespace std;
int judge(int m1,int n1)   //判断是否达到游戏结束标准的子程序 
{
int i,j,count=0;
for(i=0;i<15;i++) 
{
for(j=0;j<=10;j++)
{
if(a[i][j]==1)    //横行达到五个白色棋子的情况
......................
阅读全部 | 雪吟春晓 贴于 2018年5月10日 16:21     hide bbsi
typedef struct _queue    // 睡眠队列
{
struct tcb *tsk;
struct _queue *next;
}queue;

typedef struct _semaphore{
    int value;
queue *head;   
queue *tail;
}semaphore;

......................
阅读全部 | Zxlcqu 贴于 2018年5月8日 21:07     hide bbsi
计算一个整数的各位数字之和的程序如何编 多测试用例?测试数据有多个,一个占一行,每行是一个正整数。

最后一个测试用例是 0,表示结束。


#include<stdio.h>
int main() 

 int n,sum=0;
 while(scanf("%d",&n)==0){
if(n=0) break;
else  sum+=n%10;
......................
阅读全部 | cooee 贴于 2018年5月8日 11:38     hide bbsi
//给出一个大于等于三的数判断是不是素数
 #include"stdio.h"
 #include"stdio.h"
 int main()
 {
  int i,n,flag;
  printf("please enter a number:\n");
  scanf("%d",&n);
  for(i=2;i<=sqrt(n);i++)
   {
  if(n%i==0)
  flag=1;                                                                                                                                                                                                                                                      
......................
阅读全部 | joenejoe 贴于 2018年5月5日 15:48     hide bbsi
#include"stdio.h"
main()

{ int a,b,c,d;
printf("\t\t\t1、加法\t\t2、减法\t\t3、乘法\t\t4、除法\n");

printf("\t选择要进行的运算:");
scanf("%d",&d);

printf("输入两个数:");
scanf("%d %d",&a,&b);

......................
阅读全部 | 小缘 贴于 2018年4月30日 12:43     hide bbsi
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int ch;
    FILE *input= fopen("C:\\Users\\toby\\Desktop\\2012\\input.txt","r");
    FILE *above50= fopen("‪‪C:\\Users\\toby\\Desktop\\2012\\above50.txt","w");
    FILE *below20= fopen("C:\\Users\\toby\\Desktop\\2012\\below20.txt","w");
    while(fscanf(input,"%d",&ch)!=EOF)
    {
            if (ch>50)
......................
阅读全部 | Rs1406170125 贴于 2018年4月30日 08:57     hide bbsi
上一页 60 61 62 63 64 65 66 67 68 69 下一页