Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int variable;
- cin>> variable;
- switch(variable){
- case 1:{
- const int arraySize = 6;
- double array[arraySize];
- double input;
- int condition = 0;
- for(int i = 0; i < arraySize; i++){
- do{
- cin >> input;
- if((input >= 0) and (input <= 10)){
- array[i] = input;
- condition++;
- }
- else break;
- }while (condition < arraySize);
- }
- for(int i = 0; i < arraySize-1; i++){
- cout << array[i] << " ";
- }
- cout << array[arraySize];
- break;
- }
- case 2:{
- break;
- }
- case 3:{
- break;
- }
- default:{
- cout << "Wrong task number.";
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement