double hypot(double x, double y);
float hypot(float x, float y);
long double hypot(long double x, long double y);
而且不能跟while(cin >> input)同時使用,好像會有bug
ios::sync_with_stdio(0);
cin.tie(0);
<aside> 💡 EOF > Ctrl+Z 🔸(small orange diamond)
</aside>
#include <fstream>
fstream file;
file.open("output.txt");
fclose(fopen("output.txt", "w")); //將資料清空
file << answer << endl; //用法跟cout一樣,記得提交時改回cout
string s = "Abc";
next_permutation(s.begin(), s.end());
next_permutation(s.begin(), s.end(), compare);
//bool compare(){...}
使用目的類似boolean array,但空間和時間快上許多
#include <bitset>
using namespace std;
int main(){
bitset<10> b;
string s = "10001001";
bitset<10> b(s);
cout << b[0]; //1
b.size();
b.any(); //判斷是否有1
b.none(); //判斷是否沒1
b.count(); //1的個數 size - count = 0的個數
b.set(); //都設為1
b.reset(); //都設為0
}
emplace vs push & push_back
isalpha(char c); //判斷是否是字母 是回傳true 否回傳fasle
islower(char c);
isupper(char c);
isdigit(char c);