字节跳动校招题-【手串】

不会搞循环队列,边界情况分开讨论了一下

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

struct zhuzi{
   
    vector<int> color;
};

int main(){
   
    int n,m,c;
    scanf("%d%d%d",&n,&m,&c);
    zhuzi *O = new zhuzi[10005];
    for(int i = 0;i < n;i ++){
   
        int num_i;
        scanf("%d",&num_i);
        for(int j = 0;j < num_i;j ++){
   
  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
抱歉,作为AI语言模型,我无法编写实际的编程代码。但是,我可以为您提供一些电子手环应该包括的基本功能和一些可能有用的代码示例。 基本功能: 1. 显示时间和日期 2. 计步器和运动距离 3. 心率监测 4. 闹钟和提醒 5. 电池电量指示 6. 睡眠监测 7. 远程控制音乐播放器 可能有用的代码示例: 1. 显示时间和日期 ```python import time currentTime = time.strftime('%H:%M:%S') currentDate = time.strftime('%m/%d/%Y') print('Time:', currentTime) print('Date:', currentDate) ``` 2. 计步器和运动距离 ```python import accelerometer steps = 0 distance = 0 while True: x, y, z = accelerometer.get_values() if x > 1 or y > 1 or z > 1: steps += 1 distance += 0.5 print('Steps:', steps) print('Distance:', distance) ``` 3. 心率监测 ```python import heart_rate_monitor while True: heart_rate = heart_rate_monitor.get_heart_rate() print('Heart Rate:', heart_rate) ``` 4. 闹钟和提醒 ```python import time alarmTime = '06:00:00' while True: currentTime = time.strftime('%H:%M:%S') if currentTime == alarmTime: print('Wake up!') break time.sleep(1) ``` 5. 电池电量指示 ```python import battery batteryLevel = battery.get_battery_level() print('Battery Level:', batteryLevel) ``` 6. 睡眠监测 ```python import accelerometer sleeping = False while True: x, y, z = accelerometer.get_values() if x < 1 and y < 1 and z < 1: sleeping = True if x > 1 or y > 1 or z > 1: sleeping = False if sleeping: print('Sleeping') else: print('Awake') ``` 7. 远程控制音乐播放器 ```python import radio while True: message = radio.receive() if message == 'play': # play music elif message == 'pause': # pause music elif message == 'next': # play next song elif message == 'previous': # play previous song ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值