首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define MAX 100
typedef char ElemType;
//定义栈结构体
struct stack
{
    ElemType elem[MAX];
    int top;//顶部下标
};
//初始化栈
......................
阅读全部 | 麦子po 贴于 2019年3月19日 19:30     hide bbsi
#include<stdio.h>
int main(){
char a=0;
int b=0;
while(++a>0);
printf("有有符号的char最大整数是%d\n",a-1);//为什么输出谁-129,不是127.
while(++b>0);
printf("有符号的int最大整数是%d\n",b-1);
char d=127;
d=d+1;
printf("%d\n",d);
d=d-1;
......................
阅读全部 | 堕落之地 贴于 2019年3月11日 15:11     hide bbsi
/**
* @Title:getPayparams
* @Description:根据支付方式获取相应的支付参数
* @param orderMain
* @param payType
* @param request
* @return
* @throws Exception Result<Map<String,Object>> 返回类型
*/
public Result<Map<String, Object>> getPayparams(OrderMain orderMain, String payType, HttpServletRequest request) throws Exception{
Result<Map<String, Object>> result = new Result<Map<String, Object>>();
switch (payType) {
......................
阅读全部 | glj188350035 贴于 2019年3月4日 11: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;
......................
阅读全部 | 单维坤 贴于 2019年2月24日 22:52     hide bbsi
#include<stdio.h>
#include<string.h>
#include<math.h>
#define EPSILON 0.1
int main()
{
    double num1;
    int flag,v,w,x,y,z,len;
    char a[20]= {0};
    double b[20]= {0};
    for(int i=0; i<20; i++)
    {
......................
阅读全部 | 艾莉莎 贴于 2019年2月23日 15:39     hide bbsi
#include <stdio.h>
#include <stdlib.h>
int main() 
{
    FILE * fp ;
    char ch , filename[10] ;
    printf ( "请输入所用的文件名" ) ;
    scanf  ( "%s" , filename ) ;
    if ( ( fp = fopen ( filename , "w" ) ) == NULL )
        {
        printf ( "无法打开此文件\n" ) ;
        exit ( 0 ) ;
......................
阅读全部 | light小七 贴于 2019年1月31日 12:32     hide bbsi
#include<stdio.h>
int main()
{
void bubble_sort(int a[10]);
int s[10],i;
for(i=0;i<=9;i++)
{
scanf("%d",&s[i]);
}
bubble_sort(s);
for(i=0;i<=9;i++)
{
......................
阅读全部 | fuyumeng 贴于 2019年1月30日 18:05     hide bbsi
#include<math.h>
#include<stdio.h>
int main()
{
float a, b, c,d,e;
printf("Input parameters for the equation:\n");
scanf("%f %f %f", &a, &b, &c);
printf("The Equation: %fx^2+%fx+%f=0\n", a, b, c);
d = pow(b,2);
e = 4 * a*c;
if (d == e)
{
......................
阅读全部 | fuyumeng 贴于 2019年1月30日 18:02     hide bbsi
//汉诺塔问题
#include<stdio.h>
int main()
{
void hanoi(int n, char one, char two, char three);
int m;
printf("input the number of diskes: ");
scanf("%d", &m);
hanoi(m, 'A', 'B', 'C');
}
//将n个盘子从"one"座借助"two"座移动到"three"座的过程
void hanoi(int n, char one, char two, char three)
......................
阅读全部 | fuyumeng 贴于 2019年1月30日 18:01     hide bbsi
#include<stdio.h>
int main()
{
char c1, c2;
scanf("%c", &c1);
c2 = c1 + 32;
printf("%c\n", c2);
printf("%d\n", c2);
return 0;
}
阅读全部 | fuyumeng 贴于 2019年1月30日 17:58     hide bbsi
上一页 55 56 57 58 59 60 61 62 63 64 下一页