anonymous No title
C
#include〈stdio.h〉
 int main(void)
 {
   int n;
      while(true){
         printf(“%d¥n”,n);
n = n + 1;
      }
     return 0;
  }
anonymous No title
C
#include〈stdio.h〉
 int main(void)
 {
   int n;
     for(n=0;n<10;n++){
         printf(“%d¥n”,n);
      }
     return 0;
  }
anonymous No title
C
#include〈stdio.h〉
int main(void)
{ 
  int x;
   printf("整数を入力して下さい");
   scanf("%d",&x);
  if (x % 2)
       puts("2で割り切れません");
  else 
       puts("2で割り切れます");
    return 0;
}
anonymous No title
C
#include〈stdio.h〉
int main(void)
{ 
  int x;
   printf("整数を入力して下さい");
   scanf("%d",&x);
  if (x%2)
       puts("2で割り切れません");
  else 
       puts("2で割り切れます");
    return 0;
}
anonymous No title
C
#include〈stdio.h〉
int main(void)
{
   printf("はじめまして。¥n”);
  return 0;
}
anonymous arduino nano every で簡単なプログラム
C
const int LED_PIN = 13;         /* LED DIO                     */
const int RIG_BAND_PIN = A0;    /* BAND pin 入力               */

void setup()
{
    Serial.begin(115200);
    pinMode( LED_PIN, OUTPUT);
}

void loop()
{
    int   voltage_lsb;
    float voltage;

    voltage_lsb = analogRead( RIG_BAND_PIN);
    voltage = voltage_lsb / 1023.0;
    
    Serial.print( "LSB:");
    Serial.print( voltage_lsb);
    Serial.print( " Voltage:");
    Serial.println( voltage);
    if( voltage_lsb > 512){
        digitalWrite( LED_PIN, HIGH);
    }else{
        digitalWrite( LED_PIN, LOW);
    }
    delay(1000);
}
anonymous No title
C
#include <stdio.h>

int sum(int max, int min)
{
    int num;
    num = (max + min) * (max - min + 1) / 2;
    return num;
}

int main()
{
    int value,ma,mi;
    scanf("%d%d",&ma,&mi);
    value = sum(ma,mi) * 0.5;
    printf("%d\n", value);
    return 0;
}
anonymous No title
C
#include "hiker.h"

int answer(void)
{
    return 42;
}
anonymous No title
C
#include <stdio.h>

int main(void)
{
   int price1,price3,price5,price8,price;
   printf("定価を入力してください。");
   scanf("%d", &price);
   price1 = (int)(price * 0.9);
   price3 = (int)(price * 0.7);
   price5 = (int)(price * 0.5);
   price8 = (int)(price * 0.8);
   printf("一割引:%d\n三割引:%d\n五割引:%d\n八割引:%d\n", price1,price3,price5,price8);
   return 0;


}
anonymous No title
C
#include <iostream>
#include <algorithm>
using namespace std;

const int n=6, W=8;
const int w[n] = {2,1,3,2,1,5}, v[n]={3,2,6,1,3,85};

int dp[10][10];

int rec(int i, int cap) {
    if (dp[i][cap] != -1) {
        return dp[i][cap];
    }

    int res;
    if (i == n) {
        res = 0;
    } else if (cap < w[i]) {
        res = rec(i + 1, cap);
    } else {
        res = max(
            rec(i + 1, cap),
            rec(i + 1, cap - w[i]) + v[i]
        );
    }
    return dp[i][cap] = res;
}

int main() {
    memset(dp, -1, sizeof(dp));
    cout << rec(0, W) << endl;
}
Don't you submit code?
Submit