首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
#include<stdio.h>
#include<string.h>
int main()
{  int i,sum,count,l,j,p=1;
    char a[101];
 while(gets(a))
 {   sum=0;
       p=1;
       count=0;
 l=strlen(a);
      for(i=0;i<l;i++)
  {      if(p)
......................
阅读全部 | 谭林祥 贴于 2014年12月18日 11:57     hide bbsi
#include<iostream.h>
int main()
{
int m=3,n=4,x;
x=-m++;
x=x+8/++n;
cout<<x;
return 0;
}
阅读全部 | 中工小青年 贴于 2014年12月17日 22:37     hide bbsi
#include<stdio.h>
#include<stdlib.h>

typedef int KeyType;

typedef struct{
KeyType key;
}ElemType;

typedef struct{

ElemType *elem;
......................
阅读全部 | 晨煊 贴于 2014年12月16日 17:31     hide bbsi
求大神改,能用code.blocks运行就行,作业需要,急!!!
#ifndef H_STUDENT_HH 
#define H_STUDENT_HH 

#include "stdio.h" 
#include "string.h" 
#include "malloc.h" 


#define LEN sizeof(struct message_student) /*一个结构体数组元素的长度*/ 
#define numsubs 5 /*学科数目*/ 
typedef struct message_student /*结构体定义*/ 
......................
阅读全部 | 那时明月 贴于 2014年12月13日 23:33     hide bbsi
#include <stdio.h>//""它的查找路径是先到本地目录下查找该头文件,如果没有,就到系统目录system32下查找
//<>它的查找路径是先到系统目录下查找,如果没有,就到本地目录下查找


#define student_total 30//预编译指令,定义一个常量值
struct Student//定义学生数据类型(结构体)
{
int num;//学生学号
char name[8];//学生姓名
float normal_score;//平时成绩
float final_score;//期末成绩
float ave_score;//总评成绩=normal_score*normal_i+fianl_score*fianl_i
......................
阅读全部 | bisiqi 贴于 2014年12月12日 11:09     hide bbsi
#include<stdio.h>
void main()
{
int a,b,n=0;
bool flag;   //标志是否素数
for(a=101;a<=200;a++)
{
flag=true;  //假设为素数
for(b=2;b<=a-1;b++)
{
if(a%b==0)
{
......................
阅读全部 | word123 贴于 2014年12月11日 14:05     hide bbsi
#include <stdio.h>

int main(int argc, char* argv[])
{
    char buffer[256];
    fread(&buffer, sizeof(char), 1, stdin);
    while(1)
    {
        fflush(stdin);
        fread(&buffer, sizeof(char), 1, stdin);
        if(buffer[0]=='#') break;
    }
......................
阅读全部 | wp231957 贴于 2014年12月9日 09:45     hide bbsi
#include <stdio.h>

int mypow(int x,int n)
{
int t;
_asm
{
mov eax,1;
mov ecx,n;
     lp:
imul eax,x;
sub ecx,1;
......................
阅读全部 | wp231957 贴于 2014年12月8日 11:18     hide bbsi
printf("十六进制:%x",a);
printf("\n");
printf("八进制:%o",a);
printf("\n");


可以直接使用stdlib.h里面的 itoa(); ltoa();函数

#include <stdlib.h>
#include <stdio.h>
int main()
{
......................
阅读全部 | sunwujun 贴于 2014年12月4日 21:44     hide bbsi
#include<stdio.h>
#include<string.h>
int main()
{
int n,k,count;
char a[100];
scanf("%d",&n);
while(n--)
{
count=0;
getchar();
gets(a);
......................
阅读全部 | 微笑的代言人 贴于 2014年12月2日 18:19     hide bbsi
上一页 110 111 112 113 114 115 116 117 118 119 下一页