标签:lib pascal 使用 namespace 技术 std include 运算 http
(pascal:
pascal输出不需要说明格式,而式若子运算过程中的值都在qword范围内,则结果输出无错误。
1 begin 2 writeln(100000*100000); 3 writeln(100000*10000 mod 100); 4 end.
c:
若运算结果为long long 或 __int_64,要在式子前加上(long long) 或 (__int_64)
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 long long x; 7 x=(long long)(1000000*1000000+2); 8 printf("%lld\n",x); 9 printf("%lld\n",(long long)(1000000*1000000+2); 10 printf("%lld\n",(long long)x%5); 11 12 printf("--------\n"); 13 14 x=1000000*1000000+2; 15 printf("%lld\n",x); 16 printf("%lld\n",1000000*1000000+2); 17 printf("%ld\n",1000000000002%5); 18 19 return 0; 20 }
c++:与c一样
1 #include <iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 long long x; 8 x=(long long)(1000000*1000000+2); 9 cout<<x<<endl; 10 cout<<(long long)(1000000*1000000+2)<<endl; 11 cout<<(long long)x%5<<endl; 12 13 cout<<"--------"<<endl; 14 15 x=1000000*1000000+2; 16 cout<<x<<endl; 17 cout<<1000000*1000000+2<<endl; 18 cout<<1000000000002%5<<endl; 19 return 0; 20 }
pascal,c,c++使用大于longint(long)的整型的方式
标签:lib pascal 使用 namespace 技术 std include 运算 http
原文地址:http://www.cnblogs.com/cmyg/p/6648817.html