跳到正文

个人记录

码风

D_09约 4 分钟
原文
文章信息与版本

文章信息

发布
2025年2月2日
收录
2025年12月12日
更新
2026年11月17日
篇幅
约 4 分钟
获赞
2

版本

  1. v1当前

VS:

main

C++
#include <iostream>
#include "head_1.h"
#include "head_2.h"
#include "head_3.h"
using namespace std;
__int32 main ( ) {
	/*__int32 a = IN::READS ( );
	printer.print ( a );
	printer.print ( "\n" );*/
	system ( "pause" );
	return 0;
}

head_1:

C++
#pragma once
#include <iostream>
#include <string>
using namespace std;
namespace equ {
	double add ( double a , double b ) {
		return a + b;
	}
	double sub ( double a , double b ) {
		return a - b;
	}
	double mul ( double a , double b ) {
		return a * b;
	}
	double div ( double a , double b ) {
		return a / b;
	}
	double mod ( double a , double b ) {
		return a - a / b * b;
	}
	double auto_inc ( double a ) {
		return a + 1;
	}
	double auto_dec ( double a ) {
		return a - 1;
	}
}

head_2

C++
#pragma once
#include <iostream>
#include <string>
#include <cstdio>
#include <sstream>

class SafePrinter {
    public:
    template<typename T>
    void print ( const T &value ) {
        std::ostringstream oss;
        oss << value;
        printf ( "%s" , oss.str ( ).c_str ( ) );
    }
    void print ( const std::string &str ) {
        std::printf ( "%s" , str.c_str ( ) );
    }
    void print ( const char *str ) {
        std::printf ( "%s" , str );
    }
};
SafePrinter printer;

head_3:

C++
#pragma once
#include <iostream>
#include <string>
class IN {
    public:
    template<typename T>
    static T READC ( ) {
        T value;
        std::cin >> value; 
        return value;
    }

    static int READS ( ) {
        __int32 value;
        scanf_s ( "%d" , &value ); 
        return value;
    }
};

DEV(老式马蜂):

C++
#include <bits/stdc++.h>
using namespace std;

inline long long inputI( )
{
    long long x = 0, f = 1; char ch = getchar( );
    while( ch < '0' || ch > '9' )
	{
	    if ( ch == '-' )
		   f = -1;
		ch = getchar( );
	}
    while( ch >= '0' && ch <= '9' )
	{
	    x = x * 10 + ch - '0';
		ch = getchar( );
	}
    return x * f;
}

int main( int argc, char *argv [ ] )
{
   	return 0;
}
原文