Custom ChatGPT Plugin development

ConversAI Solutions

Code faster with the help of AI

Generate code just by typing a text description. AI will create the code for you. Test it now

Questions about programming?Chat with your personal AI assistant

How others used it recently

Generated by the communtiy

generate functionSun, 16 Jul 2023

almacenar 4 productos en un arreglo tridimensional las ventas mensuales de cada uno de ellos y el promedio de ventas durante los últimos 3 años.

#include<stdio.h> #include<stdlib.h> #include<windows.h> int main() { float producto[3][4][12],promedio[4][12]; int i,j,k; for(i=0;i<3;i++) { for(j=0;j<4;j++) { for(k=0;k<12;k++) { printf("Ingrese venta del producto %d, mes %d, año %d\n",i+1,j+1,k+1); scanf("%f",&producto[i][j][k]); } } } for(j=0;j<4;j++) { for(k=0;k<12;k++) { promedio[j][k]=0; for(i=0;i<3;i++) { promedio[j][k

C++
Guest
generate functionTue, 20 Jun 2023

create a ChatGpt clone

void chatbot() { while(true) { string userinput; getline(cin, userinput); if(userinput == "hello") cout << "Hello!" << endl; else if(userinput == "why are you so stupid?") cout << "because i am a bot" << endl; else cout << "i dont understand" << endl; } }

C++
Guest
generate functionWed, 03 May 2023

** Realizar un programa que lea una letra de la A a la L. Imprimir en pantalla el mes correspondiente a la letra. Ejemplo A es Enero, B es Febrero, C es Marzo, etc.

int main(){ char letra, mes[13]; printf("Ingrese una letra de la A a la L: "); scanf("%c", &letra); switch(letra){ case 'A': case 'a': printf("Enero"); break; case 'B': case 'b': printf("Febrero"); break; case 'C': case 'c': printf("Marzo"); break; case 'D': case 'd': printf("Abril"); break; case 'E': case 'e': printf("Mayo"); break; case 'F': case 'f': printf("Junio"); break; case 'G': case 'g': printf("Julio"); break; case 'H': case 'h': printf("Agosto"); break; case 'I': case

C++
Guest
generate functionWed, 03 May 2023

** Realizar un programa que lea una letra de la A a la L. Imprimir en pantalla el mes correspondiente a la letra. Ejemplo A es Enero, B es Febrero, C es Marzo, etc.

int main(){ char letra, mes[13]; printf("Ingrese una letra de la A a la L: "); scanf("%c", &letra); switch(letra){ case 'A': case 'a': printf("Enero"); break; case 'B': case 'b': printf("Febrero"); break; case 'C': case 'c': printf("Marzo"); break; case 'D': case 'd': printf("Abril"); break; case 'E': case 'e': printf("Mayo"); break; case 'F': case 'f': printf("Junio"); break; case 'G': case 'g': printf("Julio"); break; case 'H': case 'h': printf("Agosto"); break; case 'I': case

C++
Guest
generate functionMon, 10 Jul 2023

a) Escriba una función que reciba un vector de enteros y obtenga la posición del menor entero. b) Escriba una función que reciba un vector de enteros y una posición, elimine el entero en esa posición...

#include <iostream> #include <vector> using namespace std; int menor(vector<int> v){ int minimo = v[0]; int posicion = 0; for(int i=0; i<v.size(); i++){ if(v[i] < minimo){ minimo = v[i]; posicion = i; } } return posicion; } int eliminar(vector<int> &v, int posicion){ int valor = v[posicion]; for(int i=posicion; i< v.size(); i++){ v[i] = v[i+1]; } v.pop_back(); return valor; } int main(){ vector<int> v1 = {1,2,3,4}; vector<int> v2 = {6,5,8,7}; vector<int> v3; int n = v1.size();

C++
Guest
generate functionSat, 22 Apr 2023

create a function that takes key and plain text as inputs and outputs a cipher text using hill cipher algorithm

public string hillCipher(string key, string plainText) { string cipherText = ""; int[] keyInt = key.Select(c => (int)c).ToArray(); int[] plainTextInt = plainText.Select(c => (int)c).ToArray(); int[,] keyMatrix = new int[2, 2]; int[,] plainTextMatrix = new int[2, 1]; keyMatrix[0, 0] = keyInt[0] - 65; keyMatrix[0, 1] = keyInt[1] - 65; keyMatrix[1, 0] = keyInt[2] - 65; keyMatrix[1, 1] = keyInt[3] - 65; plainTextMatrix[0, 0] = plainTextInt[0] - 65; plainTextMatrix[1, 0] = plainTextInt[1] - 65; int[,] cipherTextMatrix = new int[2, 1]; cipherTextMatrix[0, 0] = (keyMatrix[0,

C#
Guest
generate functionSun, 23 Apr 2023

Realice una diagrama de barras con la información encontrada en la columna "Nivel"; donde éste tenga titulo, marcado el eje , el eje , las barras sean coloreadas de diferente color y las categorías en la columna "Nivel" tenga marquillas.

df = pd.read_csv("/home/oscar/Documentos/python/data.csv") df.head() df['Nivel'].value_counts().plot(kind="bar", color=["green", "blue", "red"]) plt.xlabel("Nivel") plt.ylabel("Frecuencia") plt.title("Diagrama de barras") plt.show()

Python
Guest
generate functionFri, 21 Apr 2023

標準入力から 2 つの整数を入力し、大きいほうの値を表示するプログラムを作成せよ。 (ヒント:2 つの変数を a、b とすると、a>b が「正しいとき」と「正しくないとき」でそれぞれどちらを表 示すればよいかが判断できるはずである。もし両者が同じ値のときは、a と b のどちらを表示してもよい)

a = input("a:") b = input("b:") if a > b: print(a) else: print(b)

Java
Guest

in html you can generate a beating heart with effects and colors neon

<div class="heart"> <div class="heart-main"> <div class="heart-line"> <div class="heart-line1"></div> <div class="heart-line2"></div> <div class="heart-line3"></div> <div class="heart-line4"></div> <div class="heart-line5"></div> <div class="heart-line6"></div> <div class="heart-line7"></div> <div class="heart-line8"></div> <div class="heart-line9"></div> <div class="heart-line10"></div> <div class="heart-line11"></div> <div class="heart-line12"></div> <div class="heart-line13"></div> <div class="heart-line14"></div> <div class="heart-line15"></div> <div class="heart-line16"></div> <div class="heart-line17"></div>

Guest
generate functionMon, 10 Jul 2023

a) Escriba una función que reciba un vector de enteros y obtenga la posición del menor entero. b) Escriba una función que reciba un vector de enteros y una posición, elimine el entero en esa posición...

#include <iostream> #include <vector> using namespace std; int menor(vector<int> v){ int minimo = v[0]; int posicion = 0; for(int i=0; i<v.size(); i++){ if(v[i] < minimo){ minimo = v[i]; posicion = i; } } return posicion; } int eliminar(vector<int> &v, int posicion){ int valor = v[posicion]; for(int i=posicion; i< v.size(); i++){ v[i] = v[i+1]; } v.pop_back(); return valor; } int main(){ vector<int> v1 = {1,2,3,4}; vector<int> v2 = {6,5,8,7}; vector<int> v3; int n = v1.size();

C++
Guest
generate functionTue, 28 Mar 2023

Make a program that receives as parameter a file called directorios.txt that will contain the names of directories that exist in your system. The program will have to read from the file the names of ...

def file_to_dict(file_name): file_dict = {} # open the file with open(file_name) as f: # loop through each line in the file for line in f: # remove new line character key = line.rstrip() # get the number of files in the directory file_dict[key] = len(os.listdir(key)) return file_dict def file_to_sorted_list(file_name): file_dict = file_to_dict(file_name) # return a list of directory name and number of files return sorted(file_dict.items(), key=lambda kv: kv[1]) # test for dir_name, number_of_files in file_to_sorted_list('directorios.txt'): print(f'{dir_name} has {number_of_files} files')

Java
Guest
generate functionThu, 27 Jul 2023

La automotora “Auto Seguro” necesita registrar todos los datos de los vehículos que en este periodo tienen a la venta. En el registro de vehículos que pertenece a la región metropolitana de Santiago d...

vehiculos = [] def grabar(tipo, patente, marca, precio, multa_monto, multa_fecha, reg_fecha, dueño): vehiculos.append([tipo, patente, marca, precio, multa_monto, multa_fecha, reg_fecha, dueño]) def buscar(patente): for vehiculo in vehiculos: if vehiculo[1] == patente: print(vehiculo) return True return False

Python
Guest
generate functionFri, 28 Jul 2023

Hola

fun hola(name: String) { println("Hola $name") } hola("Miguel")

Kotlin
Guest
code to explanationFri, 06 Jan 2023

if(dw_hourmeter_value >= HOUR_METER_MAX) /*if hour meter cross the maximum value, so roll-over hour meter value and trip meter shold rese...

the if statement checks the value of dw_hour_meter_value and if the value is greater or equal to the HOUR_METER_MAX then the value of dw_hour_meter_value is set to 0, the gsw_hour_meter_count is set to 0, the fnby_WritePort function is used to write 0 to the AMIL, the fnv_TripA_reset function and the fnv_TripB_reset function are called to reset the trip a and trip b variables.

Guest
generate functionSat, 18 Mar 2023

配列 A と追加する要素 B が与えられるので、B を A の末尾に追加したのち、A の全ての要素を出力してください。

public static void addToLast(int[] a, int b) { int count = a.length + 1; // 要素数が変わるので、別途 count 変数を用意する int[] newArray = new int[count]; for (int i = 0; i < a.length; i++) { newArray[i] = a[i]; } newArray[count - 1] = b; for (int i : newArray) { System.out.print(i); } } int[] arr = {1, 2, 3, 4, 5}; addToLast(arr, 6); System.out.println(arr);

Java
Guest
generate functionTue, 02 May 2023

programa para hacer sucesiones de cuadrados en consola grafica

#include <math.h> #include <graphics.h> #include <iostream> using namespace std; int main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\TC\\BGI"); int x1, y1, x2, y2; x1 = 50; y1 = 50; int n; cout << "ingrese el numero de cuadrados:"; cin >> n; cout << "ingrese el lado del cuadrado"; cin >> x2; y2 = x2; for (int i = 1; i <= n; i++) { rectangle(x1, y1, x2, y2); x1 = x1 - 10; y1 = y1 - 10; x2 = x2 + 20; y2 = y2 + 20; } getch();

C++
Guest
generate functionTue, 28 Mar 2023

Menu de 3 opciones una opcion recopilar datos personales y guardarlos en una base de datos la segunda opción que recopile notas de 3 cursos y tercera opción que recopile ausencias y tardías

def menu(): print("1. datos personales") print("2. Notas de cursos") print("3. Ausencias y Tardías") print("4. Salir") opcion = int(input("Ingrese una opción >> ")) if opcion == 1: datos_personales() elif opcion == 2: notas() elif opcion == 3: ausencias() elif opcion == 4: exit() else: print("Opción incorrecta") def datos_personales(): print("Ingrese sus datos") nombre = input("Nombre >> ") apellido = input("Apellido >> ") edad = input("Edad >> ") sexo = input("Sexo >> ") print("") print("Datos Ingresados") print("Nombre: "

Python
Guest
regex explanationTue, 09 May 2023

/^[{].+},/

The regex matches the first bracket, then any character, then any number of characters, then a comma.

Guest
generate functionSat, 26 Nov 2022

masonry layout grid vue js

import { Vue, Component, Prop, Watch } from "vue-property-decorator"; @Component({ name: "Masonry", }) export default class GridLayout extends Vue { @Prop({ default: false }) horizontal!: boolean; @Prop({ default: 200 }) gutter!: number; @Prop({ default: 0 }) column!: number; @Prop({ default: null }) minWidth!: number | null; @Prop({ default: null }) maxWidth!: number | null; @Prop({ default: null }) breakpoint!: number | null; @Prop({ default: true }) transition!: boolean; @Prop({ default: "fade" }) transitionMode!: string; @Prop({ default: 300 }) transitionDuration!: number; private $slots = this.$slots; private $props = this.$props; private currentWidth: number = 0; private currentGutterSize: number = 0; private transitionDurationStyle

TypeScript
Guest
generate functionTue, 04 Apr 2023

entendes castellano?

function hablarEspañol(persona) { if (persona === "español" || persona === "colombiano") { console.log("¡Hola!"); } else { console.log("¡Hablas inglés!"); } }

Javascript
Guest
generate functionTue, 30 May 2023

Prendere in input da utente 3 valori (diff_d1, diff_d2, diff_d3) che rappresentano il valore dei dadi del difensore. • Controllare che il valore dei dadi sia compreso nel range [0, 6]. • Controllare c...

#include <iostream> using namespace std; int main() { float diff_d1, diff_d2, diff_d3; do { cout << "Inserire il valore dei dadi del difensore:\n"; cin >> diff_d1 >> diff_d2 >> diff_d3; } while (diff_d1 < 0 || diff_d1 > 6 || diff_d2 < 0 || diff_d2 > 6 || diff_d3 < 0 || diff_d3 > 6 || (diff_d1 == 0 && diff_d2 == 0 && diff_d3 == 0)); }

C++
Guest
code to explanationFri, 06 Jan 2023

if(dw_hourmeter_value >= HOUR_METER_MAX) /*if hour meter cross the maximum value, so roll-over hour meter value and trip meter shold rese...

the if statement checks the value of dw_hour_meter_value and if the value is greater or equal to the HOUR_METER_MAX then the value of dw_hour_meter_value is set to 0, the gsw_hour_meter_count is set to 0, the fnby_WritePort function is used to write 0 to the AMIL, the fnv_TripA_reset function and the fnv_TripB_reset function are called to reset the trip a and trip b variables.

Guest
generate functionSun, 23 Apr 2023

conectarse a una base de datos llamada FeedLot de sql en la direccion 192.168.0.20, con nombre de usario root y contraseña admin, este codigo debe ser en python, despues que accesa debe entrar a una p...

import mysql.connector conecction = mysql.connector.connect(host = '192.168.0.20', user = 'root', password = 'admin', database = 'FeedLot') cursor = conecction.cursor() def menu(): print("***************************************") print("* 1. Archivo: *") print("* 2. Reporte: *") print("* 3. Consulta: *") print("* 4. Salir: *") print("***************************************") def submenu(): print("***************************************") print("* 1. Reporte semanal: *") print("* 2. Reporte mensual: *") print("* 3. Reporte anual: *") print("* 4. Salir: *") print("***************************************") def crearReporte(): print("***************************************") print("* 1. Reporte semanal: *") print("

Python
Guest
generate functionWed, 21 Dec 2022

dice gambling script

from random import randint def diceRoll(userGuess, numRoll): if userGuess == numRoll: return True else: return False def main(): numRoll = randint(1, 6) userGuess = int(input("Guess a number from 1 to 6: ")) if diceRoll(userGuess, numRoll): print("You win!") else: print("You lose. Better luck next time!") main()

Python
Guest
generate functionSat, 22 Apr 2023

create a function that takes key and plain text as inputs and outputs a cipher text using hill cipher algorithm

public string hillCipher(string key, string plainText) { string cipherText = ""; int[] keyInt = key.Select(c => (int)c).ToArray(); int[] plainTextInt = plainText.Select(c => (int)c).ToArray(); int[,] keyMatrix = new int[2, 2]; int[,] plainTextMatrix = new int[2, 1]; keyMatrix[0, 0] = keyInt[0] - 65; keyMatrix[0, 1] = keyInt[1] - 65; keyMatrix[1, 0] = keyInt[2] - 65; keyMatrix[1, 1] = keyInt[3] - 65; plainTextMatrix[0, 0] = plainTextInt[0] - 65; plainTextMatrix[1, 0] = plainTextInt[1] - 65; int[,] cipherTextMatrix = new int[2, 1]; cipherTextMatrix[0, 0] = (keyMatrix[0,

C#
Guest
generate functionTue, 04 Apr 2023

entendes castellano?

function hablarEspañol(persona) { if (persona === "español" || persona === "colombiano") { console.log("¡Hola!"); } else { console.log("¡Hablas inglés!"); } }

Javascript
Guest
generate functionMon, 08 May 2023

Write a C program to implement Caesar cipher encryption-decryption

#include <stdio.h> int main() { char message[100], ch; int i, key; printf("Enter a message to encrypt: "); gets(message); printf("Enter key: "); scanf("%d", &key); for(i = 0; message[i] != '\0'; ++i){ ch = message[i]; if(ch >= 'a' && ch <= 'z'){ ch = ch + key; if(ch > 'z'){ ch = ch - 'z' + 'a' - 1; } message[i] = ch; } else if(ch >= 'A' && ch <= 'Z'){ ch = ch + key; if(ch > 'Z'){ ch = ch - 'Z' + 'A' - 1; } message[i] = ch; } } printf("Encrypted message: %s", message); return 0

C
Guest
generate functionFri, 26 Apr 2024

área y perímetro cuadrado

ript function area(x) { return x * x; } function perimetro(x) { return x * 4; } function areaPerimetro(x) { return x * x + x * 4; } function areaPerimetro2(x) { return x * x + x * x + x * 4; } function areaPerimetro3

Javascript
Guest
generate functionFri, 05 Apr 2024

add 2 numbers and return them

You can use the following code to get the desired output. function add(a, b) { return a + b; } function subtract(a, b) { return a - b; } function multiply(a, b) { return a *

TypeScript
Guest
generate functionMon, 08 May 2023

推送公告

Script def push_notice(message): for user in users: user.receive_message(message) push_notice('hello!')

Java
Guest
ContactPrivacy Policyzigarettenautomatkarte.de