#!/bin/R -s -f # Programme test2.r # chmod a+x test2.r; ./test2.r input <- file("stdin") cat("Borne:? ") B <- readLines(input,n=1) B <- as.integer(B) while (B > 0) { for (I in 1:B) { C <- I**2 R <- sqrt(I) cat("I=",I,"I^2=",C,"I^1/2=",R,"\n") } cat("Borne:? ") B <- readLines(input,n=1) B <- as.integer(B) } cat("Fin du programme test2.r\n") q(status=0)