Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to solve the problem of data overflow in C language?
How to solve the problem of data overflow in C language?
The materials to be prepared are: computer and C language compiler.

1. First, open the C language compiler and create a new initial. A cpp file, such as test.cpp, enters the basic code of the question.

2. In the test.cpp file, adjust all int to long long, and adjust the printf function to: printf("%lld! =%lld\n ",n,count); .

3. The compiler runs the test.cpp file, and the large numbers are printed successfully.