首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看全站
#include <stdio.h>
int countNumber(int stepsNum)
{
    if (stepsNum == 0) {
        return 0;
    }
    if (stepsNum == 1) {
        return 1;
    }
    else if (stepsNum == 2) {
        return 2;
    }
......................
阅读全部 | gougoudan 贴于 2020年6月17日 11:16     hide bbsi
#include <stdio.h>
int gys(int a, int b)
{
    if (a == b) return a;
    if (a > b) return gys(a - b, b);
    return gys(a, b - a);
}

int main()
{
    int count, i;
    int data1[20] = {};
......................
阅读全部 | gougoudan 贴于 2020年6月17日 11:09     hide bbsi
#include <stdio.h>

void transpose(int mtx[3][3])
{
    int t;
    t = mtx[0][1]; mtx[0][1] = mtx[1][0]; mtx[1][0] = t;
    t = mtx[0][2]; mtx[0][2] = mtx[2][0]; mtx[2][0] = t;
    t = mtx[2][1]; mtx[2][1] = mtx[1][2]; mtx[1][2] = t;
}
int main()
{
    int i;
......................
阅读全部 | gougoudan 贴于 2020年6月17日 11:02     hide bbsi
#include <stdio.h>
int isprime(int n)
{
    if (n == 1) return 1;
    for (int i = 2; i*i <= n; i++)
        if (n%i == 0) return 0;
    return n > 1;
}
void xuanxian2()
{
    int n; int m;
    int i, s = 0;
......................
阅读全部 | gougoudan 贴于 2020年6月17日 10:55     hide bbsi
#include <stdio.h>
void shiftLeft(char str[], int count)
{
    int i;
    char temp[120];
    char* s1, *s2;
    for (i = 0; i < count; ++i){
        temp[i] = str[i];
    }
    s1 = str + count;
    s2 = str;
    while (*s2 = *s1){ ++s2; ++s1; };
......................
阅读全部 | gougoudan 贴于 2020年6月17日 10:40     hide bbsi
#include <stdio.h>
int substr(char str1[], char str2[], int index)
{
    int n = 0;
    char* s = str1;
    while (*s++) ++n;
    if (0 <= index && index < n){
        s = str1 + index;
        while(*str2++ = *s++);
        return 1;
    }
    s = "IndexError";
......................
阅读全部 | gougoudan 贴于 2020年6月17日 10:40     hide bbsi
//StudybarCommentBegin
#include <iostream>
#include <cmath>
using namespace std;
class Point
{
protected:
    double x, y;
public:
    Point(double x = 0, double y = 0)
    {
        this->x = x; this->y = y;
......................
阅读全部 | gougoudan 贴于 2020年6月16日 15:37     hide bbsi
//StudybarCommentBegin
#include <iostream>
#include <cmath>
using namespace std;
class Point
{
protected:
    double x, y;
public:
    void SetPoint(double x = 0, double y = 0)
    {
        this->x = x; this->y = y;
......................
阅读全部 | gougoudan 贴于 2020年6月16日 15:17     hide bbsi
#include <iostream>
using namespace std;

class SomeClass
{
public:
    int ma;
    double mb;
    SomeClass(){}
    SomeClass(int a, double b){ ma = a; mb = b; }
    bool operator==(const SomeClass& k) const
    {
......................
阅读全部 | gougoudan 贴于 2020年6月16日 14:51     hide bbsi
#include <stdio.h>
#include <stdlib.h>

// 坐标
typedef struct
{
    int x, y;
}SPostion;

// 栈中数据
typedef struct 
{
......................
阅读全部 | gougoudan 贴于 2020年6月16日 14:36     hide bbsi
上一页 92 93 94 95 96 97 98 99 100 101 下一页