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

int main() {
printf("我在编程中国学C语言\n\n");

// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("我爱编程中国 %d 次\n", i);
}

printf("\n\n绘制一个心形图案:");
......................
阅读全部 | bvcxz 贴于 2022年1月29日 10:40     hide bbsi
# -*- coding: UTF-8 -*- 
import pymysql

def readSQL():
    #查询 SQL 语句
    sql = "SELECT id,'apiname',apiurl from apitest_apistep where apitest_apistep.Apitest_id = 2"
    #打开 MySQL 数据库链接
    coon = pymysql.connect(user='root', passwd = 'test123456',db = 'autotest', port = 3306, host='127.0.0.1',charset='utf8')
    #获取数据库操作游标
    cursor = coon.cursor()
    #执行 MySQL 查询语句
    aa = cursor.execute(sql)
......................
阅读全部 | shlgj 贴于 2022年1月28日 14:50     hide bbsi
#-*- coding:UTF-8 -*-

def wfile():
    try: 
        filename = "C:\\Users\\zh\\"+"test.html"
    except IOError:
        print("file creat error")
    else:
        fp = open(filename,'wb')
        fp.write('test'.encode('utf-8'))
        fp.close()
        
......................
阅读全部 | shlgj 贴于 2022年1月27日 19:45     hide bbsi
#include <stdio.h>
#include <iostream>
#include <math.h>

float f(float x, float y, float z) {
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}

float h(float x, float z) {
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f) {
......................
阅读全部 | lucase 贴于 2022年1月25日 20:22     hide bbsi
#include <stdio.h>

#define PRICE 30;

int main() {
    float num,total;
    
    scanf("%f", &num);

    total=num*PRICE;
    
    printf("total = %f \n", total);
......................
阅读全部 | 蔡小菜 贴于 2022年1月25日 18:44     hide bbsi
#include <stdio.h>

#define PRICE 30;

int main() {
    float num,total;
    
    num=10.5;
    total=num*PRICE;
    
    printf("total = %f \n", total);
}
阅读全部 | 蔡小菜 贴于 2022年1月25日 18:38     hide bbsi
/**
 * 【程序2】
 * 题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月
 *       后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?
 * 程序分析:兔子的规律为数列1,1,2,3,5,8,13,21....
 */
#include <stdio.h>
 
int main()
{
    int m[23];
    int i;
......................
阅读全部 | clearlove07 贴于 2022年1月24日 15:15     hide bbsi
#五角星 画图
import  turtle
turtle.bgcolor("red")
turtle.penup()
turtle.goto(300,-300)
turtle.pendown()
turtle.forward(180)
turtle.left(72)
turtle.forward(180)
turtle.right(144)
turtle.forward(180)
turtle.left(72)
......................
阅读全部 | wde 贴于 2022年1月23日 19:17     hide bbsi
#include <stdio.h>

int main() {
printf("我叫彭江华来自湘西州\n\n");

// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("彭江华是我爸爸 %d 次\n", i);
}

printf("\n\n绘制一个五星红旗图案:");
......................
阅读全部 | wde 贴于 2022年1月23日 19:02     hide bbsi
#include <stdio.h>
#include <iostream>
#include <math.h>

float f(float x, float y, float z) {
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}

float h(float x, float z) {
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f) {
......................
阅读全部 | mature119 贴于 2022年1月19日 22:02     hide bbsi
上一页 59 60 61 62 63 64 65 66 67 68 下一页