分类
小学

北京的一些好中学点招(很多年来)都像地下党在活动

小红书上发的,注意看,是24年的帖子。不是都双减了吗?

事实上,有很多家长会送去的,因为最后证明是帝都(即北京)某中学组织的点招(不是独孤电烤)掐尖考试。

评:这些家长真大胆,你也不怕娃被割了腰子!

这国到底有多少人的脑子是被驴踢大的。

分类
文科

Every dog has his day.

狗日的总有死的那一天!

分类
编程

智商是一切一切的生物学基础

没有智力支撑的努力,是苍白无力的!

成年人的世界里只有筛选,没有教育;只有选择,没有改变。

大部分人,一辈子都一无所有,30岁过后连青春这个遮羞布都没了。

分类
文科

这是海子写的吗?

别人朝我扔泥巴,我拿泥巴种荷花。
种下荷花摘莲藕,摘下莲藕换钱花。

上了高中才知道:二本靠努力,一本靠天赋,211靠努力+天赋,985靠努力+天赋+祖坟冒青烟

分类
编程

大数阶乘的递归算法

想弄高中信息学竞赛的,过来看看。

// C++ program for the above approach 
#include <bits/stdc++.h> 
using namespace std; 

// MUltiply the number x with the number 
// represented by res array 
vector<int> multiply(long int n, vector<int> digits) 
{ 

	// Initialize carry 
	long int carry = 0; 

	// One by one multiply n with 
	// individual digits of res[] 
	for (long int i = 0; i < digits.size(); i++) { 
		long int result 
		= digits[i] * n + carry; 

		// Store last digit of 'prod' in res[] 
		digits[i] = result % 10; 

		// Put rest in carry 
		carry = result / 10; 
	} 

	// Put carry in res and increase result size 
	while (carry) { 
		digits.push_back(carry % 10); 
		carry = carry / 10; 
	} 

	return digits; 
} 

// Function to recursively calculate the 
// factorial of a large number 
vector<int> factorialRecursiveAlgorithm( 
long int n) 
{ 
	if (n <= 2) { 
		return multiply(n, { 1 }); 
	} 

	return multiply( 
	n, factorialRecursiveAlgorithm(n - 1)); 
} 

// Driver Code 
int main() 
{ 
	long int n = 50; 

	vector<int> result 
	= factorialRecursiveAlgorithm(n); 

	for (long int i = result.size() - 1; i >= 0; i--) { 
		cout << result[i]; 
	} 

	cout << "\n"; 

	return 0; 
}

想弄高中信息学竞赛的,初中就要开始练习!

新曙光188029提示用法:请在编译器中对着行号,看程序分析。

姬里源 我的写法你能看懂不,不懂语音,如果懂,那这步对不对?

紫圈部分?

姬里源:对着呢

新曙光188029:但我还是不明白,这个digits干什么用!

分类
编程

c++语法,向量容器

#include <iostream>
#include <vector>
 
int main()
{
    // Create a vector containing integers
    std::vector<int> v = {8, 4, 5, 9};
 
    // Add two more integers to vector
    v.push_back(6);
    v.push_back(9);
 
    // Overwrite element at position 2
    v[2] = -1;
 
    // Print out the vector
    for (int n : v)
        std::cout << n << ' ';
    std::cout << '\n';
}

新曙光188029提示:这是比较复杂的数据类型了。这里面的东西是有序的,不要被大括号弄糊涂了,这不是数学中的集合。

How soon will machines outsmart humans? The biggest brains in AI disagree

分类
编程

信息学:判断一个数是否是质数

// C++ program to check if a 
// number is prime 
#include <iostream> 
#include <math.h> 
using namespace std; 

int main() 
{ 
	int n, i, flag = 1; 

	// Ask user for input 
	cout << "Enter a number: "; 

	// Store input number in a variable 
	cin >> n; 

	// Iterate from 2 to sqrt(n) 
	for (i = 2; i <= sqrt(n); i++) { 

		// If n is divisible by any number between 
		// 2 and n/2, it is not prime 
		if (n % i == 0) { 
			flag = 0; 
			break; 
		} 
	} 

	if (n <= 1) 
		flag = 0; 

	if (flag == 1) { 
		cout << n << " is a prime number"; 
	} 
	else { 
		cout << n << " is not a prime number"; 
	} 

	return 0; 
} 

// This code is contributed by shivanisinghss2110.

新曙光188029提醒同学们注意,循环的上限是根号n,你知道为什么吗?

分类
编程

信息学:一元二次方程求根公式

这段代码可以求复数根:

// C++ program to find roots of
// a quadratic equation
#include <bits/stdc++.h>
using namespace std;

// Prints roots of quadratic equation
// ax*2 + bx + x
void findRoots(int a, int b, int c)
{
    // If a is 0, then equation is
    // not quadratic, but linear
    if (a == 0) {
        cout << "Invalid";
        return;
    }

    int d = b * b - 4 * a * c;
    double sqrt_val = sqrt(abs(d));

    if (d > 0) {
        cout << "Roots are real and different ";
        cout << (double)(-b + sqrt_val) / (2 * a) << " "
             << (double)(-b - sqrt_val) / (2 * a);
    }
    else if (d == 0) {
        cout << "Roots are real and same ";
        cout << -(double)b / (2 * a);
    }

    // d < 0
    else {
        cout << "Roots are complex ";
        cout << -(double)b / (2 * a) << " + i"
             << sqrt_val / (2 * a) << " "
             << -(double)b / (2 * a) << " - i"
             << sqrt_val / (2 * a);
    }
}

// Driver code
int main()
{
    int a = 1, b = -7, c = 12;

    // Function call
    findRoots(a, b, c);
    return 0;
}
分类
编程

信息学:递归调用

// C++ program to find the sum
// of natural numbers up to n
// using recursion
#include <iostream>
using namespace std;

// Returns sum of first
// n natural numbers
int recurSum(int n)
{
	if (n <= 1)
		return n;

	return n + recurSum(n - 1);
}

// Driver code
int main()
{
	int n = 5;
	cout << recurSum(n);

	return 0;
}

不是用for求和,这是理解递归调用的最简单的例子。以下是新曙光188029的小伙伴给出的运行分析:

分类
编程

左方向和右方向是手柄方向

adobe illustrator, 锚点 anchor,leftDirection and rightDirection

有诗为证:

先运行这个程序:

var docRef = documents.add();
var myPath = app.activeDocument.pathItems.add();

var newPoint = myPath.pathPoints.add();
newPoint.leftDirection = [350, 350];
newPoint.anchor = [200, 200];
newPoint.rightDirection = [350, 200];

var newPoint1 = myPath.pathPoints.add();
newPoint1.leftDirection = [500, 500];
newPoint1.anchor = [500, 500];
newPoint1.rightDirection = [500, 500];

再运行这个程序:

var myPath = app.activeDocument.pathItems.add();
myPath.setEntirePath( new Array(
new Array(500,500),
new Array(350,200)))

我用了10天时间,搞清了左倾和右倾,根本google不到,更别说百度了!

188029部落晚上都不睡觉,独孤电烤查找script说明书的handle,发现了上面一段。说明,前面理解有误,但毕竟与真相接近了一大步。

其实,就是曲线的左切线和右切线,如果你还记得数学分析里讲的左右极限,就是这个味道的!