//n阶勒让德多项式
#include<stdio.h>
int main()
{
float prond(float x,int n);
float x;
int n;
scanf("x=%f,n=%d",&x,&n);
printf("The result is :\n");
printf("%.2f ",prond(x,n));
......................
阅读全部
|
qjc451226
贴于 2016年10月4日 11:48
hide
bbsi
#include<stdio.h>
int iswanshu(int n)
{
int i,j,count ;
i=count=0 ;
j=n ;
while(i!=1)
{
i=n/2 ;
if(n%2!=0)
......................
阅读全部
|
sljofe
贴于 2016年10月3日 14:08
hide
bbsi
输入一个位数不超过5位的正整数a
(1)判断a是几位数,把位数打印出来
(2)把a的每位上的数字提取出来,并打印
(3)打印出数字a的"反数",例如 123 ->
阅读全部
|
长沙臭豆腐
贴于 2016年9月27日 16:06
hide
bbsi
#include <stdio.h>
#include <stdlib.h>
#define MAX(x,y) (((x) >= (y)) ? (x) : (y))
#define MIN(x,y) (((x) <= (y)) ? (x) : (y))
int main(void)
{
int num1 = 1;
int num2 = 2;
int num3 = 3;
......................
阅读全部
|
八画小子
贴于 2016年9月25日 21:33
hide
bbsi
#include<stdio.h>
#include<string.h>
#include<windows.h>
typedef struct Man{
char Name[12];
char Sex[4];
char Old[4];
char Mobil[12];
char Tel[12];
char Address[16];
char QQ[12];
......................
阅读全部
|
和过去说拜拜
贴于 2016年9月24日 20:20
hide
bbsi
int a[10]={9,8,7,6,5,4,3,2,1,0};
int i,j,k,temp;
for (i=0;i<10;i++)
{
k=i;
for (j=i+1;j<10;j++)
{
if (a[i]>a[j])
k=j;
if (k!=i)
{
temp=a[i];
......................
阅读全部
|
龚肖飞
贴于 2016年9月10日 14:20
hide
bbsi
#include<stdio.h>
#define MAXSIZE 100
typedef int datatype;
typedef struct{
datatype a[MAXSIZE];
int top;
}sequence_stack;
void init(sequence_stack *st)
{
st->top=0;
}
void push(sequence_stack *st,datatype x)
......................
阅读全部
|
lqx22
贴于 2016年9月9日 21:14
hide
bbsi
#include<stdio.h>
#define MAXSIZE 100
typedef int datatype;
typedef struct{
datatype a[MAXSIZE];
int top;
}sequence_stack;
void init(sequence_stack *st)
{
st->top=0;
}
void push(sequence_stack *st,datatype x)
......................
阅读全部
|
lqx22
贴于 2016年9月9日 21:04
hide
bbsi
写一个定时关机的小程序,可以立即关闭计算机,也可以一段时间后关闭计算机。
这里主要考察system()命令。
代码实现:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char cmd[20]="shutdown -s -t ";
char t[5]="0";
......................
阅读全部
|
C语言大神
贴于 2016年9月6日 21:04
hide
bbsi