%运算符
来源:互联网 发布:试卷制作软件 编辑:程序博客网 时间:2024/06/11 11:55
代码:
#include<cstdio> #include<cstdlib> #include<iostream> #include<sstream>#include<string>#include<cstring>#include<vector>#include<map>#include<stack>#include<queue>#include<algorithm>#include<cmath>#include<ctime>using namespace std;#define b -10;int main(){int a[10];srand(time(NULL));for(int i=0;i<10;i++){a[i] = rand()-10000;}for(int i=0;i<10;i++){int r = a[i] % b;cout << "a[i]" << a[i] << "r" << r<< endl;}return 0;}
结果:
a[i]9998r8
a[i]-1123r-3
a[i]2128r8
a[i]-4219r-9
a[i]19625r5
a[i]3299r9
a[i]21875r5
a[i]-4229r-9
a[i]22506r6
a[i]1530r0
--------------------------------
Process exited after 0.05035 seconds with return value 0
请按任意键继续. . .
0 0
- 运算和运算符
- 运算符
- ??运算符
- 运算符
- << 运算符
- 运算符
- 运算符
- 运算符
- 运算符
- 运算符
- 运算符
- 运算符
- ?? 运算符
- 运算符
- 运算符
- 运算符
- 运算符
- 运算符
- 16位汇编 数据段 栈段 代码段
- java.util.Date和java.sql.Date的区别和相互转化
- 基于live555实现的跨平台高性能RTSPServer流媒体服务器EasyIPCamera
- struts注解配置
- jscese 知其白 守其黑 為天下式 __Read The Fucking Source Code的博客汇总
- %运算符
- 【android开发】自定义数字软键盘的设计与实现(2)
- Linux下获取所有可用网卡信息
- ObjectC快速入门教程(3)---数组和字典
- shell脚本学习5——字符串和注释
- Laravel 5 中防止 XSS 跨站攻击的例子
- 编译问题记录
- 原始套接字抓取所有以太网数据包与分析
- EventBus的使用