This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
enum Gender{male,female}; | |
string gender_to_string(Gender gen){ | |
switch(gen){ | |
case male: | |
return "男"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
#define MAX_N 100000001 | |
int prime[MAX_N]; | |
bool is_prime[MAX_N + 1]; | |
int sieve(int n) { | |
int p = 0; | |
for (int i(0);i<=n;i++) is_prime[i] = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersController < ActionController | |
def show | |
user = User.find(params[:id].to_i) | |
render json: user, except: [:crypted_password] | |
end | |
end |