2017北邮机试

博客内容涉及计算机科学中的数学问题,具体是求解10的9次方以内6次方数的个数,给出了若干数字组合进行分析。
摘要由CSDN通过智能技术生成

计算机

原博题目搬运
在这里插入图片描述
求10^9以内6次方数的个数

#include <bits/stdc++.h>
using namespace std;
#define max 1000000000
int main(){
   
	int k,n;
	long special[30];
	int size=0;
	for(int i=1;i<=30;i++)
		if(pow(i,6)<=max) special[size++]=pow(i,6); 
	char str[1000],op[6],subs[1000];
	for(scanf("%d",&k);k--;){
   
		scanf("%d",&n);
		int i=0;
		for(;special[i]<=n;i++);
		printf("%d\n",i);
	}
	return 0;
}

在这里插入图片描述
在这里插入图片描述

9 8
1 2 3 4 5 6 7 8 9
1 4 8
5 7 9
2 2 5 3
5 5 9
3 5 8 3
4 3 8
5 7 9
5 1 9

/*
9 8
1 2 3 4 5 6 7 8 9
1 4 8
1 2 3 8 7 6 5 4 9
5 7 9
18
1 2 3 8 7 6 5 4 9
2 2 5 3
1 7 6 5 2 3 8 4 9
5 5 9
26
1 7 6 5 2 3 8 4 9
3 5 8 3
1 7 6 5 3 3 3 3 9
4 3 8
1 7 3 3 3 3 5 6 9
5 7 9
20
1 7 3 3 3 3 5 6 9
5 1 9
40
1 7 3 3 3 3 5 6 9
*/
**#include <bits/stdc++.h>
using namesp
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值