自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 C 冒泡排序

int n, buf;q < n-1;q++)i < n-1-q;i++)buf = a[i];else;j < n;j++)return 0;

2023-11-03 11:23:34 91

原创 c实现输入n个整数,输出其中最小的数,并指出它是第几个数

printf("请问你想输入几个数:");

2023-10-29 18:36:46 647 1

原创 C求斐波那契数列。

printf("请输入你要查看的第n项斐波那契值:");

2023-10-26 19:46:12 98

原创 c++ 罗马数字转正常数字

#include<iostream>#include<cstring>#include<string>#include<cstdio>using namespace std;void fun(char str1[]){ int sum,a; a = strlen(str1); for(int i=0;i<=a;i++) { if(str1[i]=='I') {...

2022-05-18 08:24:24 638

原创 一球从100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第10次落地时,共经过多少米?第10次反弹多少

from functools import reduceh = 100s = []for count in range(10): h = h/2 s.append(h) sum = reduce(lambda x,y:x+y,s)print(s)print(sum)

2021-10-29 17:22:07 286

原创 写一个函数,求三个数和的平均值。

def printo(): a=int(input("第一个数")) b=int(input("第二个数")) c=int(input("第三个数")) d = a+b+c average = d//3 print(average)printo()

2021-10-28 17:39:49 1911

原创 写一个函数,求三个数的和.

def printo(): a=int(input("第一个数")) b=int(input("第二个数")) c=int(input("第三个数")) d = a+b+c print(d)printo()

2021-10-28 17:36:53 2684

原创 写一个函数,可以通过输入的参数,打印出自定义行数的横线。

def printo(): print("------------------")n = int(input("请输入需要的横线数:"))count = 1while n >= count: printo() count+=1if n < count: exit()

2021-10-28 17:31:37 1485

原创 通过index.()的方法找到第二个‘eva‘的值并将其改成‘EVA‘

names = ['金角大王', '黑姑娘', 'rain', 'eva', '狗蛋', '银角大王', 'eva']first_index = names.index('eva')new_list = names[first_index+1:]second_index = new_list.index('eva')location = (first_index+second_index+1)names[location] = 'EVA'print(names)print(location).

2021-10-05 13:21:19 274

原创 python取出列表下标为偶数的元素。

names = ['金角大王', '黑姑娘', 'rain', 'eva', '狗蛋', '银角大王', 'eva']count = 0for i in names: names.index(i) == count while count<6 : if count %2 == 1: print(names[count]) count += 1

2021-10-05 12:56:45 6429

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除