首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
#include<stdio.h>
#include<stdlib.h>

int gcd(int x,int y)  
//欧几里得辗转相除法求两数的最大的公约数
{
    if(x<y)    return gcd(y,x);
    if(x%y!=0) return gcd(y,x%y);
    else return y;
}

void cal_formul(char* x,char* y,char* z)
......................
阅读全部 | wp231957 贴于 2014年2月25日 21:42     hide bbsi
int gcd(int x,int y)   
//欧几里得辗转相除法求两数的最大的公约数
{
if(x<y) return gcd(y,x);
if(x%y!=0) return gcd(y,x%y);
else return y;
}
阅读全部 | wp231957 贴于 2014年2月25日 15:24     hide bbsi
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
#include <direct.h> 

void getcmd(char* source,char* dest)
{
int i=0;
int j=0;
while(source[i]!=' ')
{
......................
阅读全部 | wp231957 贴于 2014年2月23日 19:16     hide bbsi
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int main(int argc, char *argv[]) 
{
system("cls");
char cmd[128]={'\0'};
char th;
int ptr=0;
while(1)
......................
阅读全部 | wp231957 贴于 2014年2月22日 21:10     hide bbsi
/*2.使用嵌套循环产生下列图案:
$
$$
$$$
$$$$
$$$$$      */
#include<stdio.h>
int main(void)
{
int i,j;
for(i=0;i<5;i++)
{
......................
阅读全部 | huzhibin 贴于 2014年2月6日 04:09     hide bbsi
#include <stdio.h>
#define zero 0.000001

double mypow(double x,int n)
{
if(n==0) return 1.0;
double t=1.0;
for(;n>0;t*=x,n--);
return t;
}

int searchroot(double x,int n)
......................
阅读全部 | wp231957 贴于 2014年2月2日 22:16     hide bbsi
#include <stdio.h>
void main()
/*1.{
int i,j;
for(i=1;i<10;i++)
{
for(j=1;j<=i;j++)
printf("%d*%d=%2d\t",i,j,i*j);
printf("\n");
}
}
阅读全部 | 沧笙 贴于 2014年1月26日 15:40     hide bbsi
/* Note:Your choice is C IDE */
#include <stdio.h>
#include <math.h>
void main()
{
 double a,b,c,delt,p1,p2,x1,x2;
    
printf("\n                ○========☆自动解一元二次方程程序☆========○\n\n-------------------------------------------------------------------------------\n\n☆(温馨提示:输入各系数的值前请把一元二次方程转化为“axx+bx+c=0”的一般形式)\n\n●请输入方程各系数的值:\n\n");

    printf("○请输入a的值:\n");  scanf("%lf",&a);
printf("○请输入b的值:\n");  scanf("%lf",&b);
printf("○请输入c的值:\n");  scanf("%lf",&c);
......................
阅读全部 | alienware328 贴于 2014年1月22日 16:21     hide bbsi
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>

#define OVERFLOW -2
#define FALSE -1
#define OK 0

#define ElemType  int 

 struct LNode{
ElemType coefficient;//系数 
......................
阅读全部 | 似水流年强 贴于 2014年1月22日 09:37     hide bbsi
#include <stdio.h>

int main()
{
    char *s[512];
    scanf("%s", s);
    *(stdin->_ptr) = '\0';
    printf("------神奇的分割线开始------\n");
    int len= (int)(stdin->_ptr-stdin->_base);
    printf("正序输出为:%s\n", stdin->_base);
    printf("倒序输出为:");
    while(len>0)
......................
阅读全部 | wp231957 贴于 2014年1月20日 14:42     hide bbsi
上一页 122 123 124 125 126 127 128 129 130 131 下一页